You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.

DATETIME


Converts a value of another data type into a datetime. 


Syntax

DATETIME(string value, [format])
DATETIME(date value)


Inputs

  • value - The value of the data type that is converted to datetime. 

  • format (optional) - The format used for conversion. Format must be enclosed by quotes, e.g. “yyyy-MM-dd hh:mm:ss”. For more info on specifying datetime format patterns, please see Date and time formats or patterns


Default formats

For all conversion functions that use a string as parameter, the [format] describes the format in which the input string value parameter is in. When not specifying a format, by default this format is used: 

  • string to datetime - yyyy-MM-dd hh:mm:ss. 


Return type

  • date


Examples

  • DATETIME("2021-02-18 12:55:34") results in a datetime value of 18-02-2021 12:55:34 (default format is used). 
  • DATETIME("19861221 12:02:56", "yyyyMMdd HH:mm:ss") results in a datetime value of 21-12-1986 12:02:56 (specified format is used). 

Back to Top