When using string dates or datetimes, the date format should be specified to ensure compatibility with non Informix
DBMS.
Example
Copy
<date format="dd-MM-yy HH:mm:ss">'14-04-08 01:02:03'</date>
1.1 Java date format
Formats must follow the Java date and time pattern format:
yy
|
2-digit year
|
yyyy
|
4-digit year
|
MM
|
01-12 month
|
dd
|
01-31 day
|
HH
|
00-23 hour
|
mm
|
00-59 minute
|
ss
|
00-59 second
|
Returns current date.
<today value='year|month|day'/>
Attributes |
Name | Type | Required | Default | Description |
Avalue | string | | | | You can specify if you want to know year, month or day. |
Returns |
Type | Description |
Date | Returns a date. |
Example
If the example were made on February 19, 2008, it would return 2008-02-19.
Values
In these cases it returns a numeric value, not a date.
Copy
<today value="month"/>
<today value="year"/>
<today value="day"/>
Returns current date and time.
<current />
Extracts a date.
<date
trunc='yes|y'
format='format'
>
<expresion /> *
</date>
Attributes |
Name | Type | Required | Default | Description |
Atrunc | string | | | | It is so that in ORACLE a DATE of a TIMESTAMP can be obtained. Values: Yes|y |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | date | | | | Date. |
Returns |
Type | Description |
Integer | Returns a date. |
Example
Copy
<select>
<columns>
<date format='dd-MM-yy'>'14-04-08'</date>
</columns>
<from table='test'/>
</select>
Convert three integer values into DATE format.
<mdy
d='d'
m='m'
y='y'
>
<d> *
<day /> *
</d>
<m> *
<month /> *
</m>
<y> *
<year /> *
</y>
</mdy>
Attributes |
Name | Type | Required | Default | Description |
Ad | integer | | | | Day. |
Am | integer | | | | Month. |
Ay | integer | | | | Year. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Ed | null | | | | |
Eday | integer | | | | Day. |
Em | null | | | | |
Emonth | integer | | | | Month. |
Ey | null | | | | |
Eyear | integer | | | | Year. |
Example
Copy
<mdy d='14' m='04' y='2008' />
Returns the year of a date.
<year format='format'>
<value /> *
</year>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Evalue | date | | | | A date. |
Returns |
Type | Description |
Integer | Returns the year of the date. |
Date
Copy
<year><today/></year>
String
Copy
<year format="dd-MM-yy">'14-04-08'</year>
Returns the month of a date.
<month format='format'>
<fecha /> *
</month>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Efecha | date | | | | |
Returns |
Type | Description |
Integer | Returns the month. |
Date
Copy
<month><today/></month>
String
Copy
<month format="dd-MM-yy">'14-04-08'</month>
Returns the day of the week represented by numbers from 0 to 6, where 0 equals Sunday, 1 Monday, etc...
<weekday format='format'>
<value /> *
</weekday>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Evalue | date | | | | A date. |
Returns |
Type | Description |
Integer | Day of the week represented by an integer. |
Date
Copy
<weekday><today/></weekday>
String
Copy
<weekday format="dd-MM-yy">'14-04-08'</weekday>
Returns the day of a date.
<day format='format'>
<expresion /> *
</day>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | date | | | | It can be, for example, <today />. |
Returns |
Type | Description |
Integer | Return day. |
String
Copy
<day format="dd-MM-yy">'14-04-08'</day>
Returns the last day of the month of a date.
<lastday format='format'>
<expresion /> *
</lastday>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | date | | | | It can be, for example, <today />. |
Returns |
Type | Description |
Date | Returns the date of the last day of the month. |
Date
Copy
<lastday><today/></lastday>
String
Copy
<lastday format="dd-MM-yy">'14-04-08'</lastday>
Extract the hour from a date.
<hour format='format'>
<fecha /> *
</hour>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Efecha | datetime | | | | It can be, for example, <current />. |
Returns |
Type | Description |
Integer | Returns the hour. |
Date
Copy
<hour><current/></hour>
String
Copy
<hour format="dd-MM-yy HH:mm:ss">'14-04-08 01:02:03'</hour>
Extracts the minute of a date.
<minute format='format'>
<fecha /> *
</minute>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Efecha | datetime | | | | It can be, for example, <current />. |
Returns |
Type | Description |
Integer | Returns the minute. |
Date
Copy
<minute><current/></minute>
String
Copy
<minute format="dd-MM-yy HH:mm:ss">'14-04-08 01:02:03'</minute>
Extracts the second of a date.
<second format='format'>
<fecha /> *
</second>
Attributes |
Name | Type | Required | Default | Description |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Efecha | datetime | | | | It can be, for example, <current />. |
Returns |
Type | Description |
Integer | Returns the second. |
Date
Copy
<second><current/></second>
String
Copy
<second format="dd-MM-yy HH:mm:ss">'14-04-08 01:02:03'</second>
Returns the number of days between two dates or datetimes.
The start date and the end date can be indicated as attributes or arguments.
<days
datefrom='datefrom'
dateto='dateto'
format='format'
>
<datefrom format='format'> *
<date /> *
</datefrom>
<dateto format='format'> *
<date /> *
</dateto>
</days>
Attributes |
Name | Type | Required | Default | Description |
Adatefrom | date/datetime | | | | Date or date-time of start. |
Adateto | date/datetime | | | | Date or time-date of end. |
Aformat | string | | | | Indicates the @datefrom and @dateto dates format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Edatefrom | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of start. |
Edateto | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of end. |
Dates
Copy
<days><datefrom>date_updated</datefrom><dateto>date_created</dateto></days>
Strings 1
Copy
<days datefrom="16-04-18" dateto="14-04-18" format="dd-MM-yy"/>
Strings 2
Copy
<days>
<datefrom format="dd-MM-yy">'16-04-18'</datefrom>
<dateto format="dd-MM-yy">'14-04-18'</dateto>
</days>
Returns a string with the date difference in days, hours as minutes, with the format: 01d 01h 01m
.
<sub-dates
datefrom='datefrom'
dateto='dateto'
format='format'
>
<datefrom format='format'> *
<date /> *
</datefrom>
<dateto format='format'> *
<date /> *
</dateto>
</sub-dates>
Attributes |
Name | Type | Required | Default | Description |
Adatefrom | date/datetime | | | | Date or date-time of start. |
Adateto | date/datetime | | | | Date or date-time of end. |
Aformat | string | | | | Indicates the @datefrom and @dateto dates format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Edatefrom | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of start. |
Edateto | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of end. |
Dates
Copy
<sub-dates><datefrom>date_updated</datefrom><dateto>date_created</dateto></sub-dates>
Strings 1
Copy
<sub-dates datefrom="14-04-18 01:02:03" dateto="16-04-18 03:02:01" format="dd-MM-yy HH:mm:ss"/>
Strings 2
Copy
<sub-dates>
<datefrom format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</datefrom>
<dateto format="dd-MM-yy HH:mm:ss">'16-04-18 03:02:01'</dateto>
</sub-dates>
Returns the number of seconds between two dates or datetimes.
<seconds
datefrom='datefrom'
dateto='dateto'
format='format'
>
<datefrom format='format'> *
<date /> *
</datefrom>
<dateto format='format'> *
<date /> *
</dateto>
</seconds>
Attributes |
Name | Type | Required | Default | Description |
Adatefrom | date/datetime | | | | Date or date-time of start. |
Adateto | date/datetime | | | | Date or date-time of end. |
Aformat | string | | | | Indicates the @datefrom and @dateto dates format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Edatefrom | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of start. |
Edateto | null | | | | |
Aformat | string | | | | Indicates the date format. |
Edate | date | | | | Date or date-time of end. |
Dates
Copy
<seconds><datefrom>date_updated</datefrom><dateto>date_created</dateto></seconds>
Strings 1
Copy
<seconds datefrom="14-04-18 01:02:03" dateto="14-04-18 03:02:01" format="dd-MM-yy HH:mm:ss"/>
Strings 2
Copy
<seconds>
<datefrom format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</datefrom>
<dateto format="dd-MM-yy HH:mm:ss">'14-04-18 03:02:01'</dateto>
</seconds>
This tag allows you to perform arithmetic operations of addition and subtraction on dates.
<eval-date
d='d'
m='m'
y='y'
format='format'
>
<val
unit='y|m|d|date'
format='format'
> *
<value /> *
</val>
<date /> *
</eval-date>
Attributes |
Name | Type | Required | Default | Description |
Ad | integer | | | | Day. |
Am | integer | | | | Month. |
Ay | integer | | | | Year. |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Eval | null | | | |
It is mandatory to report a
val
with attribute
unit='date'
|
Aunit | string | | | | Unit being specified. |
Aformat | string | | | | Indicates the date format. |
Evalue | integer | | | | For the values y|m|d it is the number of units (days, years, months ...) specified in the unit attribute that you want to add to the date.
For the date value, it is the date on which you want to perform arithmetic operations.
|
Edate | date | | | | Initial date. |
Returns |
Type | Description |
Date | Returns a date. |
Dates 1
Copy
<eval-date y='1' m='2' d='-3'><today/></eval-date>
Dates 2
Copy
<eval-date>
<val unit="y">1</val>
<val unit="m">2</val>
<val unit="d">-3</val>
<val unit="date"><current/></val>
</eval-date>
String 1
Copy
<eval-date y='1' m='2' d='-3' format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</eval-date>
String 2
Copy
<eval-date>
<val unit="y">1</val>
<val unit="m">2</val>
<val unit="d">-3</val>
<val unit="date" format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</val>
</eval-date>
This tag allows you to perform arithmetic operations of addition and subtraction on expressions of datetimes type.
<eval-datetime
y='y'
m='m'
d='d'
h='h'
min='min'
s='s'
format='format'
>
<val
unit='y|m|d|h|min|s|datetime'
format='format'
> *
<value /> *
</val>
<date /> *
</eval-datetime>
Attributes |
Name | Type | Required | Default | Description |
Ay | integer | | | | Year. |
Am | integer | | | | Month. |
Ad | integer | | | | Day. |
Ah | integer | | | | Hours. |
Amin | integer | | | | Minutes. |
As | integer | | | | Seconds. |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Eval | null | | | |
It is mandatory to report a
val
with attribute
unit='datetime'
|
Aunit | string | | | | Unit being specified. |
Aformat | string | | | | Indicates the date format. |
Evalue | integer | | | | For the values y|m|d|h|min|s, it is the number of units (days, years, months ...) specified in the unit attribute to be added to the date.
For the date value, it is the date on which you want to perform arithmetic operations.
|
Edate | date | | | | Initial datetime. |
Returns |
Type | Description |
Date | Returns a datetime. |
Dates 1
Copy
<eval-datetime y='1' m='3' d='2' h="7" min="5" s="2"><current/></eval-datetime>
Dates 2
Copy
<eval-datetime>
<val unit='d'>2</val>
<val unit='m'>3</val>
<val unit='y'>1</val>
<val unit='h'>7</val>
<val unit='min'>5</val>
<val unit='s'>2</val>
<val unit='datetime'><today/></val>
</eval-datetime>
String 1
Copy
<eval-datetime y='1' m='3' d='2' h="7" min="5" s="2" format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</eval-datetime>
String 2
Copy
<eval-datetime>
<val unit='d'>2</val>
<val unit='m'>3</val>
<val unit='y'>1</val>
<val unit='h'>7</val>
<val unit='min'>5</val>
<val unit='s'>2</val>
<val unit='datetime' format="dd-MM-yy HH:mm:ss">'14-04-18 01:02:03'</val>
</eval-datetime>
It allows to increase or decrease the precision of a DATETIME variable.
<extend
from='from'
to='to'
format='format'
>
<variable /> *
</extend>
Attributes |
Name | Type | Required | Default | Description |
Afrom | string | | | | |
Ato | string | | | | |
Aformat | string | | | | Indicates the date format. |
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Evariable | date | | | | Variable of the DATETIME type defined above. |
Returns |
Type | Description |
Date | Returns a date. |
Date
Copy
<extend from="year" to="second"><today/></extend>
String
Copy
<extend from="year" to="day" format="dd-MM-yy HH:mm:ss">'14-04-18 03:02:01'</extend>
Given a number of seconds, it generates an interval DAY TO SECOND.
<seconds-todsinterval>
<num_seconds /> *
</seconds-todsinterval>
Arguments |
Name | Type | Required | Unique | Nullable | Description |
Enum_seconds | decimal | | | | Total number of seconds that form the interval. If this value is greater than 59, the seconds are accumulated in higher units: minutes, hours and days.
|
Returns |
Type | Description |
Interval | Returns the extension interval DAY TO SECOND. |
Example
Get INTERVAL DAY TO SECOND for 80 seconds.
Copy
<seconds-todsinterval>80</seconds-todsinterval>