Function: time.format

Formats the given timestamp as a human-readable string.

Arguments

Arguments
seconds

integer|float

A timestamp in seconds since epoch.

timezone

string

A timezone name from the tz database: http://en.wikipedia.org/wiki/Tz_database . If not specified or if an empty string, the default is UTC.

Returns

A timestamp string in ISO 8601 format, up to a microsecond precision. For example: "2024-01-10T16:15:54.615087Z".

Examples

 # Format given timestamp as human-readable string 
 # For example, returns "2024-07-12T12:50:33.000000Z" 
 - 
  
 returnStep 
 : 
  
 return 
 : 
  
 ${time.format(1720788633,"GMT")} 
 # For example, returns "2024-07-12T12:50:33.000000Z" 
 - 
  
 returnStep 
 : 
  
 return 
 : 
  
 ${time.format(1720788633)} 
 # For example, returns "2024-07-12T14:50:33.000000+02:00" 
 - 
  
 returnStep 
 : 
  
 return 
 : 
  
 ${time.format(1720788633,"Europe/Paris")} 
 # Or, you can use `sys.now` which returns Unix time 
 - 
  
 returnStep 
 : 
  
 return 
 : 
  
 ${time.format(sys.now())} 
Design a Mobile Site
View Site in Mobile | Classic
Share by: