// // OS_File_Time: C // // Convert file.time to REBOL date/time format. // Time zone is UTC. // void OS_File_Time(REBREQ *file, REBOL_DAT *dat) { SYSTEMTIME stime; TIME_ZONE_INFORMATION tzone; if (TIME_ZONE_ID_DAYLIGHT == GetTimeZoneInformation(&tzone)) tzone.Bias += tzone.DaylightBias; FileTimeToSystemTime(cast(FILETIME *, &file->special.file.time), &stime); Convert_Date(&stime, dat, -tzone.Bias); }
// // OS_Get_Time: C // // Get the current system date/time in UTC plus zone offset (mins). // void OS_Get_Time(REBOL_DAT *dat) { SYSTEMTIME stime; TIME_ZONE_INFORMATION tzone; GetSystemTime(&stime); if (TIME_ZONE_ID_DAYLIGHT == GetTimeZoneInformation(&tzone)) tzone.Bias += tzone.DaylightBias; Convert_Date(&stime, dat, -tzone.Bias); }
*/ void OS_File_Time(REBREQ *file, REBOL_DAT *dat) /* ** Convert file.time to REBOL date/time format. ** Time zone is UTC. ** ***********************************************************************/ { SYSTEMTIME stime; TIME_ZONE_INFORMATION tzone; if (TIME_ZONE_ID_DAYLIGHT == GetTimeZoneInformation(&tzone)) tzone.Bias += tzone.DaylightBias; FileTimeToSystemTime((FILETIME *)(&(file->file.time)), &stime); Convert_Date(&stime, dat, -tzone.Bias); }
*/ void OS_Get_Time(REBOL_DAT *dat) /* ** Get the current system date/time in UTC plus zone offset (mins). ** ***********************************************************************/ { SYSTEMTIME stime; TIME_ZONE_INFORMATION tzone; GetSystemTime(&stime); if (TIME_ZONE_ID_DAYLIGHT == GetTimeZoneInformation(&tzone)) tzone.Bias += tzone.DaylightBias; Convert_Date(&stime, dat, -tzone.Bias); }