This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Timestamp
|
Timestamp -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | String |
![]() |
Current time returned using ISO format with milliseconds | |||||
Timestamp returns the current UTC time in ISO format with milliseconds, i.e. yyyy-MM-ddTHH:mm:ss.SSSZ. Note that the "Z" character indicates the GMT time zone.
Each time returned by Timestamp is expressed according to the ISO 8601 standard. For more information about this standard, refer to: https://en.wikipedia.org/wiki/ISO_8601
Note: This function is not suitable for timing purposes; you should use Milliseconds when you want to measure elapsed time.
You can use Timestamp in a log file to know precisely when the events occurred. As shown below, you may have several operations occurring during the same second:
$vhDocRef:=Append document("TimestampProject.log")
$logWithTimestamp:=Timestamp+Char(Tab)+"Log with timestamp"+Char(Carriage return)
SEND PACKET($vhDocRef;String($logWithTimestamp))
Result:
2016-12-12T13:31:29.477Z Log with timestamp
2016-12-12T13:31:29.478Z Connection of user1
2016-12-12T13:31:29.486Z ERROR - Exception of type 'System exception'
2016-12-12T13:31:29.492Z Click on button1684
2016-12-12T13:31:29.502Z [SP_HELP- 1 rows] Command processed
2016-12-12T13:31:29.512Z [SP_HELP- 5 rows] Result set fetched
Product: 4D
Theme: Date and Time
Number:
1445
Created: 4D v16 R2
4D Language Reference ( 4D v20 R7)