class O2GTimeConverter

Brief

The class provides a method to convert datetime values between the time zones.

Details

To get an instance of the class, use the O2GSession.getTimeConverter method. For example,

O2GTimeConverter converter = mSession.getTimeConverter();

To convert a datetime value to a different time zone, use the convert method of the class. For example, to convert a datetime value from Universal Time Coordinated zone to the Eastern Standard Time zone, write the following line:

calDate = converter.convert(date, O2GTimeConverterTimeZone.UTC, O2GTimeConverterTimeZone.EST);

Available time zones are specified by the O2GTimeConverterTimeZone enum.

Example

Convert datetime value from UTC into the EST zone [hide]

O2GTimeConverter converter = mSession.getTimeConverter();
DateTime date = DateTime.UtcNow;
Console.WriteLine("Date in UTC timezone: " + date.ToString("yyyy-MM-dd HH:mm"))
date = converter.convert(date, O2GTimeConverterTimeZone.UTC, O2GTimeConverterTimeZone.EST);
Console.WriteLine("Date in EST timezone: " + date.ToString("yyyy-MM-dd HH:mm"))

The type defined in the fxcore2.dll assembly. The namespace is fxcore2.

Public Methods

convert

Converts a datetime value to a specified time zone.

back