Clascov Posted July 5, 2008 Share Posted July 5, 2008 (edited) Sorry, just realised I made a mistake - DOH. Wish I could delete this post - is that possible ? Edited July 5, 2008 by Clascov Link to comment Share on other sites More sharing options...
Andreik Posted July 5, 2008 Share Posted July 5, 2008 (edited) _DateDiff seems to fail for the difference in days if the time is included in the date/time strings passed AND the first date/time parameter is 'older'. Tried the code examples below in both v3.2.10.0 and v3.2.11.9 (beta), and all work as expected except the first where $diff = $error = 0. Searched the posts without success and would be grateful for a clue. $diff = _DateDiff("d","2008/07/04 14:07:14","2008/07/05 12:26:54") MsgBox(0,"","diff = " & $diff & ", error = " & @error) $age = _DateDiff("d","2008/07/05 12:26:54","2008/07/04 14:07:14") MsgBox(0,"","diff = " & $diff & ", error = " & @error) $diff = _DateDiff("d","2008/07/04","2008/07/05") MsgBox(0,"","diff = " & $diff & ", error = " & @error) $diff = _DateDiff("d","2008/07/05","2008/07/04") MsgBox(0,"","diff = " & $diff & ", error = " & @error)[/code Sorry, just realised my mistake - DOH. [/quote] Here:$diff = _DateDiff("d","2008/07/05","2008/07/04") MsgBox(0,"","diff = " & $diff & ", error = " & @error) Start time and end time. Can we tell us what you resolve? Edited July 5, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Clascov Posted July 5, 2008 Author Share Posted July 5, 2008 Sorry to waste your time Andreik. Should have realised that start/end datetime was less than 24 hours - so _DateDiff returned the correct value. Link to comment Share on other sites More sharing options...
Andreik Posted July 5, 2008 Share Posted July 5, 2008 Sorry to waste your time Andreik.Should have realised that start/end datetime was less than 24 hours - so _DateDiff returned the correct value.Thanks Clascov! When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now