改进ToDateTime在输入时间为0时的处理
This commit is contained in:
parent
6aec9ccacf
commit
c7f4421c61
@ -118,9 +118,17 @@ namespace hgl
|
||||
FILETIME ft,local_ft;
|
||||
SYSTEMTIME st;
|
||||
|
||||
if(cur_time<=0)
|
||||
{
|
||||
GetLocalTime(&st);
|
||||
SystemTimeToFileTime(&st,&ft);
|
||||
}
|
||||
else
|
||||
{
|
||||
MicroTimeToFileTime(&ft, cur_time*HGL_MICRO_SEC_PER_SEC);
|
||||
|
||||
FileTimeToSystemTime(&ft, &st);
|
||||
}
|
||||
|
||||
FileTimeToLocalFileTime(&ft, &local_ft);
|
||||
|
||||
d.Set(st.wYear, st.wMonth, st.wDay, st.wDayOfWeek);
|
||||
|
Loading…
x
Reference in New Issue
Block a user