[Gambas-user] datediff problem

nando nando_f at ...951...
Sat Aug 1 17:33:47 CEST 2015


Here's an example.

  Dim FirstDate as Date

  FirstDate = Date(2015, 1, 1, 0, 0, 0, 0)
  Print DateDiff(firstdate, Date(2015, 8, 1, 00, 00, 00), gb.day)  'ok
  Print DateDiff(firstdate, Date(2015, 8, 1, 00, 00, 01), gb.day)  'ok
  Print DateDiff(firstdate, Date(2015, 8, 1, 03, 59, 59), gb.day)  'ok
  Print DateDiff(firstdate, Date(2015, 8, 1, 04, 00, 00), gb.day)  'Wrong
  Print DateDiff(firstdate, Date(2015, 8, 1, 11, 21, 51), gb.day)  'Wrong

212
212
212
213  <---Wrong  should be 212
213  <---Wrong  should be 212

Of course, this is looks like it might be a TimeZone problem.
I am in GMT -5 but daylight savings during the summer it is -4

Am I correct to say this is not correct operation?

-Nando






More information about the User mailing list