Converts a datetime from the local time zone to UTC. 

UtcDatetime = SRP_DateTime("ToUTC", Datetime)


A datetime in OI's internal format.


TimeA datetime in OI's internal format. (REQUIRED)


The "ToUTC" service converts the given datetime–assumed to be in the local time zone–into the UTC time zone. It handles edge cases, so if the local time zone is Pacific Standard Time and the local time is 1/17/2020 at 10pm, it will return 1/18/2020 at 6am. If you want the current time in UTC, it's simpler to use the Now service. This service is more useful for converting pre-existing dates.


// Parse a local datetime, entered by the user, and convert it to UTC
Datetime = SRP_DateTime("Parse", UserInput, "DDD, M MMM YYYY hh:mm:ss")
UtcDatetime = SRP_DateTime("ToUTC", Datetime)
  • No labels