This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20.6
Timestamp

Timestamp 


 

Timestamp -> Function result 
Parameter Type   Description
Function result  String in 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.

Example  

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



See also 

Milliseconds
String
Time

 
PROPERTIES 

Product: 4D
Theme: Date and Time
Number: 1445

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v16 R2

 
ARTICLE USAGE

4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)