4D v12.1 provides new automatic date/time formats to make it easier to generate time stamps. These formats are particuarly useful with XML and Web processing .
These new formats are available using the existing String command. In order to handle date/time combinations, this command now accepts an optional third parameter: combTime. This Time type parameter is used only when the expression parameter is a Date (see below).
The ISO Date date format (returns a date in ISO8601 format) can now combine a time with the result obtained when you pass a time in the third parameter:
$mydate:=String(Current date;ISO Date)
$mydate:=String(Current date;ISO Date;Current time)
The new ISO Date GMT date format is similar to the ISO Date format except that it expresses the date and time with respect to the time zone (the ISO Date format expresses the local date and time).
$mydate:=String(Current date;ISO Date GMT;Current time)
Note that the "Z" character at the end indicates the GMT format.
If you only pass a date, the command returns the date at midnight (local time) expressed in GMT time which may cause the date to be moved forward or back depending on the local time zone:
$mydate:=String(Current date;ISO Date GMT)
You can use the new Date RFC 1123 date format to format a date/time combination according to the standard defined by RFC 822 and 1123. You need this format for example to set the expiration date for cookies in an HTTP header.
$mydate:=String(Current date;Date RFC 1123;Current time)
The time expressed takes the time zone into account (GMT zone). If you only pass a date, the command returns the date at midnight (local time) expressed in GMT time which may cause the date to be moved forward or back depending on the local time zone: