Tech Tip: Time command accepts Longint
PRODUCT: 4D | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: June 19, 2014
IN 4D v14, the command Time now accepts longint as well as string in its first parameter. If a longint is passed in, it will be interpreted as time in seconds.
The following command:
Time(43200)
will return 12:00:00.
This is the same as calling Time with a string:
Time(“12:00:00”) //returns 12:00:00
The difference from Time and Time string is that it returns a Time instead of a String. To convert the returned time variable into a string, simply use either Time String, or String on it.
C_TIME($time_t) C_TEXT($time_s) $time_t:=Time(43200) $time_s:=Time string($time_t) |