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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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 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

  • No labels