コード例 #1
0
ファイル: TimeZone.c プロジェクト: buGGycoder/SortedTable
MEMBER_METHOD_IMPLEMENT(TimeZone, Now, ERROR_CODE, OUT LocalDateTime* localTime)
{
    ERROR_CODE error = ERROR_UNKNOWN;
    struct timeval tv = {0};
    if (gettimeofday(&tv, NULL))
    {
        return ERROR_MACHINE_ILL;
    }

    DateTime* utcTime = I_VAR(DateTime);
    if (ERROR_NO != (error = utcTime->InitializeByTotalMicroseconds(utcTime, TIMEVAL_TO_MICROSECONDS(tv))))
    {
        I_DISPOSE(DateTime, utcTime);
        return error;
    }

    return thiz->GetLocalDateTime(thiz, utcTime, localTime);
}