Erel i try To understand why the old method while looks ok gives wrong result and found this.
I set the device with this settings:
Device settings:
date: 01/Jan/2013 (No DST on this time)
TimeZone: +3
Time: 10:00:00 AM
(Offset from UTC: +3)
Dim InputDate, OnlyTime As Long
InputDate = DateTime.Now
OnlyTime = InputDate Mod DateTime.TicksPerDay
Log(DateTime.time(OnlyTime)) 'Original time 10:00:00 AM and Returns 10:00:00 AM. OK.
Log(DateTime.GetHour(OnlyTime)) '10
Then i change the settings of device with:
Device settings:
date: 01/Jul/2013 (We have DST on this time)
TimeZone: +4
Time: 10:00:00 AM
(Offset from UTC: +4, (timezone +3 and DST +1))
and try the same code
Dim InputDate, OnlyTime As Long
InputDate = DateTime.Now
OnlyTime = InputDate Mod DateTime.TicksPerDay
Log(DateTime.time(OnlyTime)) 'Original time 10:00:00 AM and Returns 09:00:00 AM.
Log(DateTime.GetHour(OnlyTime)) '9
DateTime.Time ignores the DST? The same happend with DateTime.Hour