diff options
Diffstat (limited to 'plugins/ImportTXT')
-rw-r--r-- | plugins/ImportTXT/BqhfIP.inc | 2 | ||||
-rw-r--r-- | plugins/ImportTXT/General.pas | 6 | ||||
-rw-r--r-- | plugins/ImportTXT/ImportTU.pas | 4 |
3 files changed, 4 insertions, 8 deletions
diff --git a/plugins/ImportTXT/BqhfIP.inc b/plugins/ImportTXT/BqhfIP.inc index 91160dd1cc..aa7a9a8758 100644 --- a/plugins/ImportTXT/BqhfIP.inc +++ b/plugins/ImportTXT/BqhfIP.inc @@ -96,7 +96,7 @@ begin dbei.szModule := PAnsiChar(proto);
dbei.timestamp := RLInteger(pt + i + $12);
dbei.timestamp := dbei.timestamp -
- (Cardinal(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, dbei.timestamp, 0)) - dbei.timestamp); // приводим к GMT
+ (Cardinal(TimeZone_ToLocal(dbei.timestamp)) - dbei.timestamp); // приводим к GMT
if PByte(pt + i + $1A)^ = $00 then
dbei.flags := DBEF_READ or DBEF_UTF
else
diff --git a/plugins/ImportTXT/General.pas b/plugins/ImportTXT/General.pas index e6bac9318b..3fedce5df0 100644 --- a/plugins/ImportTXT/General.pas +++ b/plugins/ImportTXT/General.pas @@ -476,14 +476,10 @@ end; function TimeStampToWStr(ts: DWORD): WideString;
var
- dbtts: TDBTIMETOSTRING;
s: WideString;
begin
SetLength(s, 20);
- dbtts.szFormat.w := 'd s';
- dbtts.szDest.w := PWideChar(s);
- dbtts.cbDest := 20;
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, ts, int(@dbtts));
+ TimeZone_ToStringW(ts, 'd s', PWideChar(s), 20);
result := s;
end;
diff --git a/plugins/ImportTXT/ImportTU.pas b/plugins/ImportTXT/ImportTU.pas index b81a21167d..2fac66ad55 100644 --- a/plugins/ImportTXT/ImportTU.pas +++ b/plugins/ImportTXT/ImportTU.pas @@ -60,7 +60,7 @@ begin DT := (D * 24 * 60 * 60) + (Hour * 3600 + Min * 60 + Sec);
// Приводим к GMT...судя по всему миранда хранит таймштампы в GMT
if toGMT then
- Result := DT - (Longword(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, DT, 0)) - DT)
+ Result := DT - (Longword(TimeZone_ToLocal(DT)) - DT)
else
Result := DT;
end;
@@ -69,7 +69,7 @@ function DateTimeToTimeStamp(const DateTime: TDateTime; toGMT: Boolean = true): begin
Result := Round((DateTime - UnixDateDelta) * SecsPerDay);
if toGMT then
- Result := Result - (Dword(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, Result, 0)) - Result);
+ Result := Result - (Dword(TimeZone_ToLocal(Result)) - Result);
end;
function ChangeUnicode(str: PWideChar): PWideChar;
|