bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Building Queries and Data Views

 Previous Next Contents Index View as PDF  

Date and Time Functions

Date and Time functions extract all or part of a dateTime expression and use it in a query. The following date and time functions are available:

xf:add-days

Adds the number of days specified by Parameter2 to the date specified by Parameter1. The value of Parameter2 may be negative.

Data Types

Notes

If Parameter1 has a timezone, it remains unchanged. The returned value is always normalized into a correct Gregorian calendar date. If either parameter is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:current-dateTime

Returns the current date and time.

Data Types

No parameters required.

Returned data type: xs:dateTime

Notes

The function returns the current date and time in the current timezone.

If the function is called multiple times during the execution of a query, it returns the same value each time.

XQuery Specification Compliance

Liquid Data returns the time zone where the Liquid Data Server is running.

Example

xf:current-dateTime() can return a dateTime value such as 2002-07-25T01:00:38.812-08:00, which represents July 25th, 2002 at 1:00:38 and 812 thousandths of a second in a time zone that is offset by -8 hours from GMT (UTC).

 


xf:date

Returns a date from a source value, which must contain a date in one of these formats:

where:

Data Types

Notes

The representation for date is the leftmost representation for dateTime: YYYY-MM-DD+hh:mm with an optional following time zone indicator (Z).

Liquid Data supports this year range: 0000-9999.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xfext:date-from-dateTime

Returns the leftmost date portion of a dateTime value.

Data Types

Notes

This is an extended function. It has an xfext: prefix identifier (namespace), which is the extension to the standard XQuery function namespace (xf:). For more information about extended functions, see Naming Conventions. For more information about valid formats for dateTime, see xf:dateTime.

XQuery Specification Compliance

Liquid Data supports date-from-dateTime as an extended function.

Examples

 


xfext:date-from-string-with-format

Returns the right-most date portion of a dateTime value according to the pattern specified by Parameter1. For more information, see Date and Time Patterns.

Data Types

Notes

This is an extended function. It has an xfext: prefix identifier (namespace), which is the extension to the standard XQuery function namespace (xf:). For more information about extended functions, see Naming Conventions.

XQuery Specification Compliance

Liquid Data supports date-from-string-with-format as an extended function.

Examples

 


xf:dateTime

Returns a dateTime value from a source value, which must contain a date and time in one of these formats:

where the following is true:

Data Types

Notes

Returns a date and time in YYYY-MM-DDT+hh:mm:ss format.

This expression can be preceded by an optional leading minus (-) sign to indicate a negative number. If the sign is omitted, positive (+) is assumed.

Use additional digits to increase the precision of fractional seconds if desired. The format ss.ss... with any number of digits after the decimal point is supported. Fractional seconds are optional.

Liquid Data supports this year range: 0000-9999.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xfext:dateTime-from-string-with-format

Returns a new dateTime value from a string source value according to the pattern specified by Parameter1.

Data Types

Notes

This is an extended function. It has an xfext: prefix identifier (namespace), which is the extension to the standard XQuery function namespace (xf:).

For more information about extended functions, see Naming Conventions, and see Date and Time Patterns.

XQuery Specification Compliance

Liquid Data supports dateTime-from-string-with-format as an extended function.

Examples

 


xf:get-hours-from-dateTime

Returns an integer value representing the hour identified in dateTime.

Data Types

Notes

The hour value ranges from 0 to 23.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:get-hours-from-time

Returns an integer representing the hour identified in time.

Data Types

Notes

The hour value ranges from 0 to 23, inclusive.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:get-minutes-from-dateTime

Returns an integer value representing the minutes identified in dateTime.

Data Types

Notes

Returns an integer value representing the minute identified in the source value. The minute value ranges from 0 to 59, inclusive.

If the source value is an empty list, the function returns the empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:get-minutes-from-time

Returns an integer value representing the minutes identified in time.

Data Types

Notes

The minute value ranges from 0 to 59.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:get-seconds-from-dateTime

Returns an integer value representing the seconds identified in dateTime.

Data Types

Notes

The seconds value ranges from 0 to 60.999. The precision (number of digits) of fractional seconds depends on the relevant facet of the argument.

The value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:get-seconds-from-time

Returns an integer value representing the seconds identified in time.

Data Types:

Notes

The seconds value ranges from 0 to 60.999. The precision (number of digits) of fractional seconds depends on the relevant facet of the argument.

The value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xf:time

Returns a tine from a source value, which must contain the time in one of these formats:

where the following is true:

Data Types

Notes

Liquid Data generates an error if it cannot parse the string successfully.

XQuery Specification Compliance

Conforms to the current specification.

Examples

 


xfext:time-from-dateTime

Returns the time from dateTime.

Data Types

Notes

This is an extended function. It has an xfext: prefix identifier (namespace), which is the extension to the standard XQuery function namespace (xf:). For more information about extended functions, see Naming Conventions. For more information about valid formats for dateTime, see xf:dateTime.

XQuery Specification Compliance

Liquid Data supports time-from-dateTime as an extended function.

Examples

 


xfext:time-from-string-with-format

Returns a new time value from a string source value according to the pattern specified by Parameter1.

Data Types

Notes

This is an extended function. It has an xfext: prefix identifier (namespace), which is the extension to the standard XQuery function namespace (xf:).

For more information about extended functions, see Naming Conventions, and see Date and Time Patterns.

XQuery Specification Compliance

Liquid Data supports time-from-string-with-format as an extended function.

Examples

 


 

Back to Top Previous Next