Returns the object Time hour:minutes:seconds for the date/time indicated using the attributes or the argument of the function.

In the table Relation attribute-argument are shown when the differents attributes intervene depending on if the value is indicated by attributes or argument. The date/time of entry has the application server's time zone and the returned time has the user's time zone. There is a conversion process between the time of entry and exit when the time zones of the application server and the user are different. And also you can modify the offset (milliseconds) of the input time using the Z attribute.

If this attribute is used with an half hour unit (multiples of 3600000) will be equal to modify/move the time zone of the value entered to the east (positive) or to the west (negative).

1 date.time

<date.time
    hh='hh'
    mm='mm'
    ss='ss'
    SS='SS'
    Z='Z'
    format='format'
>
    <time /> ?
</date.time>

Exceptions

java.lang.NumberFormatException: For input string

The type of attributes should be numeric.

Bad type - expected [string] while found [Object]

The argument that can be indicated to the function has to be Date or String type.

Example

Examples with application server and user in the same time zone (GMT+1).

Copy
<xsql-script name='date.time_sample1'>
    <body>
        <println>Hour entry of the server 10:20:00 using attributes</println>
       <println><date.time hh='10' mm='20' ss='00'></date.time></println>
       RESULT: 10:20:00

       <println>Hour entry of the server 10:20:00 using the argument</println>
       <println><date.time>10:20:00</date.time></println>
       RESULT: 10:20:00

       <println>Hour entry of the server 10:20:00 using the argument. The format hh:mm:ss is indicated</println>
       <println><date.time format='hh:mm:ss'>10:20:00</date.time></println>
       RESULT: 10:20:00

       <println>Hour entry of server 10:20:00 using the argument. The format mm:hh:ss is indicated</println>
       <println><date.time format='mm:hh:ss'>20:10:00</date.time></println>
       RESULT: 10:20:00

       <println>User with time zone GMT-6. Server in time zone GMT+1. Entered value modified with offset 0 Zone GMT+0</println>
       <set name='res'><string><date.time hh='10' Z='0' /></string></set>
       <println><res /></println>
       RESULT: 11:00:00

       <println>User with time zonbe GMT-6. Server in time zone GMT+1. Entered value modified with offset 1H Zone GMT+1</println>
       <set name='res'><string><date.time hh='10' Z='3600000' /></string></set>
       <println><res /></println>
       RESULT: 10:00:00

       <println>User with time zone GMT-6. Server in time zone GMT+1. Entered value modified with offset -1H Zone GMT-1</println>
       <set name='res'><string><date.time hh='10' Z='-3600000' /></string></set>
       <println><res /></println>
       RESULT: 12:00:00
    </body>
</xsql-script>
Example

Examples with application server in time zone GMT+1 and user in the time zone GMT-6. Six time zones of difference.

Copy
<xsql-script name='date.time_sample1'>
   <body>
       <println>Hour entry of the server 10:20:00 using attributes</println>
       <println><date.time hh='10' mm='20' ss='00'></date.time></println>
       RESULT: 3:20:00

       <println>Hour entry of the server 10:20:00 using the argument</println>
       <println><date.time>10:20:00</date.time></println>
       RESULT: 3:20:00

       <println>Hour entry of the server 10:20:00 using the argument. The format hh:mm:ss is indicated</println>
       <println><date.time format='hh:mm:ss'>10:20:00</date.time></println>
       RESULT: 3:20:00

       <println>Hour entry of the server 10:20:00 using the argument. The format mm:hh:ss is indicated</println>
       <println><date.time format='mm:hh:ss'>20:10:00</date.time></println>
       RESULT: 3:20:00

       <println>User with time zone GMT-6. Server in time zone GMT+1. Entered value modified with offset 0 Zone GMT+0</println>
       <set name='res'><string><date.time hh='10' Z='0' /></string></set>
       <println><res /></println>
       RESULT: 4:00:00

       <println>User with time zone GMT-6. Server in time zone GMT+1. Entered value modified with offset 1H Zone GMT+1</println>
       <set name='res'><string><date.time hh='10' Z='3600000' /></string></set>
       <println><res /></println>
       RESULT: 3:00:00

       <println>User with time zone GMT-6. Server in time zone GMT+1. Entered value modified with offset -1H Zone GMT-1</println>
       <set name='res'><string><date.time hh='10' Z='-3600000' /></string></set>
       <println><res /></println>
       RESULT: 5:00:00
   </body>

</xsql-script>

1.1 The attributes that are applied according to the argument that is introduced

Relation attribute-argument
Argument/Attributes hh mm ss SS Z format
Without arguments.            
Argument type string.            
Argument type date.