2
votes
Fix: Now() returns incorrect time on iOS device
The Hacker's Corner
– var TZOffsetFromGMT : Integer; procedure TForm1.FormCreate(Sender: TObject); begin TZOffsetFromGMT := NSTimeZone.localTimeZone.secondsFromGMT; end; use it later as follows: var Hour, Min, Sec, MSec : Word; CurrTime : TDateTime; begin CurrTime := Now+TZOffsetFromGMT/3600.0/24.0; DecodeTime(CurrTime,Hour,Min,Sec,MSec); … end; Share This | Email this page to a friend
Statistics
|
Visits by Source |
User Actions |




