Collaboration diagram for Utility functions:
![]() |
Defines | |
#define | TZ_EASTERN_US TEXT("Eastern Standard Time" ) |
#define | TZ_CENTRAL_US TEXT("Central Standard Time" ) |
#define | TZ_MOUNTAIN TEXT("Mountain Standard Time") |
#define | TZ_PACIFIC_US TEXT("Pacific Standard Time" ) |
#define | TZ_ALASKA TEXT("Alaska Standard Time" ) |
Functions | |
const OlDefaultFolders | getDefaultFolderType (const std::wstring &itemType) |
const OlItemType | getOlItemType (const std::wstring &itemType) |
const std::wstring | getItemTypeFromOlType (const OlItemType olType) |
void | manageComErrors (_com_error &e) |
const std::wstring | getNameFromVersion (std::wstring version) |
void | doubleToSystemTime (std::wstring &systemDate, const DATE doubleDate, const BOOL toUTC, const bool onlyDate=false) |
Variant time (double) -> System time ("YYYYMMDD" or "YYYYMMDDThhmmssZ") The output value is a string. | |
void | systemTimeToDouble (const std::wstring &dataString, DATE *date, bool onlyDate=false) |
String time ("YYYYMMDDThhmmssZ" or "YYYYMMDD") -> Variant time (double). | |
void | localTimeToUTC (SYSTEMTIME &sysTime) |
Converts 'sysTime' from local time to UTC. | |
void | UTCToLocalTime (SYSTEMTIME &sysTime) |
Converts 'sysTime' from UTC to local time. | |
bool | adjustDSTSettings (TIME_ZONE_INFORMATION *timeZoneInfo, SYSTEMTIME targetTime) |
Correct the DST dates inside timeZoneInfo passed, if necessary. | |
bool | isTZForDSTChange (const std::wstring &tzName) |
Returns true if the passed timezone name is one of the timezones that changed their rule in 2007. | |
BOOL | vBoolToBOOL (VARIANT_BOOL vbool) |
Variant bool (-1/0) to BOOL (1/0). | |
bool | vBoolToBool (VARIANT_BOOL vbool) |
Variant bool (-1/0) to bool (true/false). | |
VARIANT_BOOL | BOOLToVBool (BOOL b) |
BOOL (1/0) to Variant bool (-1/0). |
bool adjustDSTSettings | ( | TIME_ZONE_INFORMATION * | timeZoneInfo, | |
SYSTEMTIME | targetTime | |||
) |
Correct the DST dates inside timeZoneInfo passed, if necessary.
In 2007 the DST rules chaged for U.S. and Canada, so we need to adjust the timeZoneInfo if current Timezone is one of the timezones affected by the change of Energy Policy Act of 2005.
timeZoneInfo | [IN-OUT] the TIME_ZONE_INFORMATION structure to adjust | |
targetTime | the target date/time analyzed |
void doubleToSystemTime | ( | wstring & | systemDate, | |
const DATE | doubleDate, | |||
const BOOL | toUTC, | |||
const bool | onlyDate | |||
) |
Variant time (double) -> System time ("YYYYMMDD" or "YYYYMMDDThhmmssZ") The output value is a string.
It's in UTC based on param 'toUTC'. If onlyDate = true, toUTC is ignored.
systemDate | [OUT] the date returned in SystemTime format | |
doubleDate | the input date in variant time format | |
toUTC | TRUE if we want conversion in UTC format (YYYYMMDDThhmmssZ) | |
onlyDate | if true, the output systemTime is in date format "yyyyMMdd" (hours info are cut) |
void localTimeToUTC | ( | SYSTEMTIME & | sysTime | ) |
Converts 'sysTime' from local time to UTC.
Uses the specific settings for the time zone and daylight saving time that are applied to the 'sysTime' date.
void systemTimeToDouble | ( | const wstring & | dataString, | |
DATE * | date, | |||
bool | onlyDate | |||
) |
String time ("YYYYMMDDThhmmssZ" or "YYYYMMDD") -> Variant time (double).
Automatic conversion from UTC to Local time if input time is UTC. If onlyDate = true, time is not converted to UTC and hour is forced to 00:00.
dataString | the input string in System time format | |
date | [OUT] the returned value into VariantTime format | |
onlyDate | if true, time is not converted to UTC and hour is forced to 00:00. |
void UTCToLocalTime | ( | SYSTEMTIME & | sysTime | ) |
Converts 'sysTime' from UTC to local time.
Uses the specific settings for the time zone and daylight saving time that are applied to the 'sysTime' date.