![]() |
Vault
4.1
|
You can provide a callback interface for VInstant to allow for converting to and from "remote time zones" (RTZ). More...
#include <vinstant.h>
Public Member Functions | |
virtual void | offsetToRTZStruct (Vs64 offset, const VString &timeZoneID, VInstantStruct &when)=0 |
Converts an offset (ms from 1970 UTC, same as VInstant "value") to a broken-down calendar time in the specified time zone. | |
virtual Vs64 | offsetFromRTZStruct (const VString &timeZoneID, const VInstantStruct &when)=0 |
Converts a broken-down calendar time, interpreted in the specified time zone, to an offset (ms from 1970 UTC, same as VInstant "value"). |
You can provide a callback interface for VInstant to allow for converting to and from "remote time zones" (RTZ).
Currently the built-in code of VInstant (using OS-provided functions) can only convert between UTC and the local time zone.
To implement remote time zone conversion, implement this interface, and call VInstant::setRemoteTimeZoneConverter(). Then you can pass RTZ specifiers to the VInstant APIs that allow them, and VInstant will call back to the installed RTZ converter interface.
Definition at line 379 of file vinstant.h.
virtual void IVRemoteTimeZoneConverter::offsetToRTZStruct | ( | Vs64 | offset, |
const VString & | timeZoneID, | ||
VInstantStruct & | when | ||
) | [pure virtual] |
Converts an offset (ms from 1970 UTC, same as VInstant "value") to a broken-down calendar time in the specified time zone.
This function should throw a VException if the time zone ID is invalid.
offset | a number milliseconds since UTC 1970 00:00:00.000 |
timeZoneID | a time zone ID string (e.g., PST, EST, etc.) from the set of strings supported by the converter |
when | a structure that will be filled to contain the y/m/d/h/m/s for the specified UTC offset as seen in the specified time zone |
virtual Vs64 IVRemoteTimeZoneConverter::offsetFromRTZStruct | ( | const VString & | timeZoneID, |
const VInstantStruct & | when | ||
) | [pure virtual] |
Converts a broken-down calendar time, interpreted in the specified time zone, to an offset (ms from 1970 UTC, same as VInstant "value").
This function should throw a VException if the time zone ID is invalid.
timeZoneID | a time zone ID string (e.g., PST, EST, etc.) from the set of strings supported by the converter |
when | a structure containing y/m/d/h/m/s values in the specified time zone |