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>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Ahh | Integer | Indicated hour (Hour of the server). When passing an argument to the function, the attribute has no effect on the result. | |||
Amm | Integer | Indicated minutes (Minute of the server). When passing an argument to the function, the attribute has no effect on the result. | |||
Ass | Integer | Indicated seconds (Seconds of the server). When passing an argument to the function, the attribute has no effect on the result. | |||
ASS | Integer | Indicated milliseconds (Milliseconds of the server). When passing an argument to the function, the attribute has no effect on the result. | |||
AZ | Integer | GMT 'Offset' in milliseconds. It make reference to the time zone of the entry attributes that is that passed by respect to the Greenwich Meridian. Allows to transfer for the differents time zones. If you want to advance from Greenwich to the east, an offset of 3600000 is subtracted for each time zone. If you want to advance from Greenwich to the west, an offset of 3600000 is added for each time zone. | |||
Aformat | String | Format of the data entered. This attribute only makes sense if an argument is passed to it and this is of type String.
If you enter the time attributes (hh,mm,ss or SS) or the argument is of date type, this field has no effect on the result (see the table Relación atributo-argumento).
To specify which the entry argument (String) has the format Minutes:Hours:Seconds, you should write:
|
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etime | String |
Returns | |
---|---|
Type | Description |
Date | Generated date. |
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.
Examples with application server and user in the same time zone (GMT+1).
<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>
Examples with application server in time zone GMT+1 and user in the time zone GMT-6. Six time zones of difference.
<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. |