Exemplo n.º 1
0
//
//  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);
}
Exemplo n.º 2
0
//
//  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);
}
Exemplo n.º 3
0
Arquivo: host-lib.c Projeto: Oldes/r3
*/	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);
}
Exemplo n.º 4
0
Arquivo: host-lib.c Projeto: Oldes/r3
*/	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);
}