Datediff differences in US and Europe

Ivan Smahin ivan_smahin at paradigmasoft.com
Wed Jun 27 08:48:42 CDT 2012


On Jun 27, 2012, at 4:17 PM, jda wrote:

> Hi Ruslan,
> 
> I have a method that uses datediff to determins if a record was created in the last 2 weeks:
> 
>      dateAdded > datediff( now(), '01/01/1904 00:00:00', 'second' ) - (14 * 24 * 60 * 60) 
> 
> This works well on US Macs.
> 
> You told me to use
> 
>       dateAdded > datediff( now(), '01-01-1904 00:00:00', 'second' ) - (14 * 24 * 60 * 60)
> 
> for European systems. I checked this by changing my settings to German (in the International System Preferences). But not neither search works.
> 
> So, what should I use for the day, month, and year for different regions?
> 


I suspect that such a problem will be arisen sooner or later.
Actually now() is about local time - so you can not use it worldwide as a timestamp.

Usually UTC time is used for such purposes.
But I can not recall - do we have such a function or not.


-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120627/78e33785/attachment.html>


More information about the Valentina mailing list