Official Content

Converts a DateTime value to Coordinated Universal Time (UTC), assuming that the DateTime to convert to is the server's time zone.

Syntax

DateTime-expression.ToUniversalTime()

Where:

DateTime-expression
     
Is a DateTime expression to which the method applied converts to Coordinated Universal Time (UTC).

Type returned:
DateTime

Scope

Data Types:  DateTime
Generators: .NET.NET Framework, Java, Ruby (up to GeneXus X Evolution 3)

Samples

&MeetingInUTC = &MeetingDateTime.ToUniversalTime()
&MeetingInUTC = &MeetingDateTime.AddDays(5).ToUniversalTime()

See Also

Coordinated Universal Time (UTC)
The TimeZone problem
DateTime storage timezone property
TimeZone support - Compatibility considerations
DateTime data type




Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant