util.Datetime.format()

util.Datetime.format() formats a DATETIME value according to the specified format.

Syntax

util.Datetime.format(value, format)

Parameters

value

a DATETIME value that must be formatted

format

a format string (STRING)

Usage and examples

util.Datetime.format() takes a DATETIME value and formats it according to the specified format:

DISPLAY util.Datetime.format(CURRENT,"%Y-%m-%d %H:%M")

If the source value is NULL, util.Datetime.format() will return NULL.

example code #1

MAIN

    DISPLAY CURRENT

    DISPLAY util.Datetime.format(CURRENT, "%Y-%m-%d %H:%M")

  CALL fgl_getkey()

END MAIN

obtained results #1

example code #2

MAIN

    DISPLAY util.Datetime.format(CURRENT, "%c")

    DISPLAY util.Datetime.format(CURRENT, "%x")

    DISPLAY util.Datetime.format(CURRENT, "%X")

  CALL fgl_getkey()

END MAIN

obtained results #2

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.