Class FUN_dateTime

  • All Implemented Interfaces:
    Function

    public final class FUN_dateTime
    extends FunctionBase
    Binding function fun:dateTime converts a given datetime or a UNIX timestamp in milliseconds to an xsd:dateTime.

    See Live example

    • args contains the supplied arguments such that
      • the first argument is either a datetime (String) or a UNIX timestamp in milliseconds (String or integer);
      • the second argument is optional. If provided contains the parsing format string in the ISO 8601 format according to universal time;
      • if there is no second argument, the first argument must be a UNIX timestamp in milliseconds (String or integer);
    • Result is a xsd:dateTime.
    Examples:
     
     fun:dateTime(1453508109000) => "2016-01-23T01:15:09Z"^^http://www.w3.org/2001/XMLSchema#dateTime
     fun:dateTime("1453508109000") => "2016-01-23T01:15:09Z"^^http://www.w3.org/2001/XMLSchema#dateTime
     fun:dateTime("04/09/2018","dd/MM/yyyy") => "2018-09-04T00:00:00Z"^^http://www.w3.org/2001/XMLSchema#dateTime
     fun:dateTime("2018-09-01T20:13:42Z", "ISO_DATE_TIME") => "2018-09-01T20:13:42Z"^^http://www.w3.org/2001/XMLSchema#dateTime
     fun:dateTime("2018-09-01", "ISO_DATE") => "2018-09-01T00:00:00Z"^^http://www.w3.org/2001/XMLSchema#dateTime
     
     
    Since:
    2018-09-05
    Author:
    El Mehdi Khalfi