AnsweredAssumed Answered

Timestamp() function returns incorrect results

Question asked by comment_1 on Jun 13, 2009
Latest reply on Jul 7, 2009 by TSGal

Summary

Timestamp() function returns incorrect results

Description of the issue

The Timestamp() function returns incorrect results in some cases:Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( 0 ; 0 ; -1 ) ) Expected result: 12/31/2008 23:59:59Actual result: 1/1/2009 0:00:00However,Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( -1 ; 0 ; 0 ) ) returns the expected 12/31/2008 23:00 It seems that whenever the time parameter is between 0 and -1 hour (non-inclusive), the result returned is incorrect.This bug affects all versions from version 7 and up, on both Windows and OS X (Intel - couldn't test on PPC).Further tests reveal even weirder results:Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( 0 ; 0 ; -.5 ) ) returns1/1/2009 0:00:00.467296but:GetAsNumber (Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( 0 ; 0 ; -.5 ) )  )returns a correct result of 63366364799.5 and:GetAsTimestamp ( GetAsNumber (Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( 0 ; 0 ; -.5 ) )  ) )also returns the expected 12/31/2008 23:59:59.5 However, GetAsDate (Timestamp ( Date ( 1 ; 1 ; 2009 ) ; Time ( 0 ; 0 ; -.5 ) ) )  returns - incorrectly -  1/1/2009.    

Outcomes