Skip to content

Commit

Permalink
deprecated GetCurLocMSecs, added GetCurUniUnixMSecs
Browse files Browse the repository at this point in the history
  • Loading branch information
rupnikj committed Aug 2, 2018
1 parent 3cdc23b commit 7fee062
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/glib/base/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ uint64 TSysTm::GetCurUniMSecs(){
return UInt64.Val/uint64(10000);
}

uint64 TSysTm::GetCurLocMSecs(){
SYSTEMTIME SysTm; FILETIME FileTm;
GetLocalTime(&SysTm);
IAssert(SystemTimeToFileTime(&SysTm, &FileTm));
TUInt64 UInt64(uint(FileTm.dwHighDateTime), uint(FileTm.dwLowDateTime));
return UInt64.Val/uint64(10000);
}
// uint64 TSysTm::GetCurLocMSecs(){
// SYSTEMTIME SysTm; FILETIME FileTm;
// GetLocalTime(&SysTm);
// IAssert(SystemTimeToFileTime(&SysTm, &FileTm));
// TUInt64 UInt64(uint(FileTm.dwHighDateTime), uint(FileTm.dwLowDateTime));
// return UInt64.Val/uint64(10000);
// }

uint64 TSysTm::GetMSecsFromTm(const TTm& Tm){
SYSTEMTIME SysTm; FILETIME FileTm;
Expand Down Expand Up @@ -634,9 +634,9 @@ uint64 TSysTm::GetCurUniMSecs(){
return TSysTm::GetMSecsFromTm(GetCurLocTm());
}

uint64 TSysTm::GetCurLocMSecs(){
return TSysTm::GetMSecsFromTm(GetCurUniTm());
}
// uint64 TSysTm::GetCurLocMSecs(){
// return TSysTm::GetMSecsFromTm(GetCurUniTm());
// }

uint64 TSysTm::GetMSecsFromTm(const TTm& Tm){
time_t t;
Expand Down
4 changes: 2 additions & 2 deletions src/glib/base/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class TSysTm{
static TTm GetCurUniTm();
static TTm GetCurLocTm();
static uint64 GetCurUniMSecs();
static uint64 GetCurLocMSecs();
// static uint64 GetCurLocMSecs(); // deprecated
static uint64 GetMSecsFromTm(const TTm& Tm);
static TTm GetTmFromMSecs(const uint64& MSecs);
static uint GetMSecsFromOsStart();
Expand Down Expand Up @@ -228,7 +228,7 @@ class TSysTm{
static TTm GetCurUniTm();
static TTm GetCurLocTm();
static uint64 GetCurUniMSecs();
static uint64 GetCurLocMSecs();
//static uint64 GetCurLocMSecs(); // deprecated
static uint64 GetMSecsFromTm(const TTm& Tm);
static TTm GetTmFromMSecs(const uint64& MSecs);
static uint GetMSecsFromOsStart();
Expand Down
8 changes: 6 additions & 2 deletions src/glib/base/tm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,10 +1093,14 @@ uint64 TTm::GetCurUniMSecs(){
return TSysTm::GetCurUniMSecs();
}

uint64 TTm::GetCurLocMSecs(){
return TSysTm::GetCurLocMSecs();
uint64 TTm::GetCurUniUnixMSecs(){
return TTm::GetUnixMSecsFromWinMSecs(TTm::GetCurUniMSecs());
}

// uint64 TTm::GetCurLocMSecs(){
// return TSysTm::GetCurLocMSecs();
// }

uint64 TTm::GetMSecsFromTm(const TTm& Tm){
return TSysTm::GetMSecsFromTm(Tm);
}
Expand Down
3 changes: 2 additions & 1 deletion src/glib/base/tm.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ class TTm{
static TTm GetUniqueCurUniTm(const int& UniqueSpaces, const int& UniqueSpaceN);
static TTm GetCurLocTm();
static uint64 GetCurUniMSecs();
static uint64 GetCurLocMSecs();
static int64 GetCurUniUnixMSecs(); //< Number of milliseconds since 1970-01-01T00:00:00 (UTC)
//static uint64 GetCurLocMSecs(); // Deprecated
static uint64 GetMSecsFromTm(const TTm& Tm);
static TTm GetTmFromMSecs(const uint64& MSecs);
static uint GetMSecsFromOsStart();
Expand Down

0 comments on commit 7fee062

Please sign in to comment.