Datediff differences in US and Europe

Robert Brenstein rjb at robelko.com
Fri Jun 29 08:47:50 CDT 2012


On 29.06.2012 at 8:50 Uhr -0400 jda apparently wrote:
>What is "now" for Valentina on a Mac. Is it the seconds after 
>1/1/1904 (which is how Macs deal with dates)? This is why we had the 
>problem in the first place, because we had to subtract the date 
>1/1/1904 from now() to do the comparison.

Hmm, if you are looking only at a difference between two dates, their 
reference date (1904 or 1970) is irrelevant as long as both dates use 
the same. But you probably need to display them in human-readable 
form at some point.

If you are working on a single platform, you could store dates as 
seconds (that is unix time) to make things simpler. I often store 
them in parallel as seconds and datetimeitems (y,m,d,h,m,s,t), former 
for calculations and latter for easy inspection and display, or as 
yyyymmdd depending on the project. Storing as date/time fields is the 
most headache usually.

Robert


More information about the Valentina mailing list