KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting UTC time in ISO format in 4D
PRODUCT: 4D | VERSION: 16 R2 | PLATFORM: Mac & Win
Published On: January 19, 2017

4D v16 R2 introduces a new command to obtain the current UTC time in ISO format. The new command Timestamp returns a string that contains the time with the following format:

   yyyy-MM-ddTHH:mm:ss.SSSZ

This command simplifies self created logging systems so that an entire timestamp is generated with a single native 4D command, instead of using PHP commands or a compination of Current date and Current time. This format is also compatible with the JSON format for Object types.

C_OBJECT($objectVar)
OB SET($objectVar;"Time";Timestamp)