Datediff differences in US and Europe

Bart Pietercil bart.pietercil at cognosis.be
Thu Jun 28 07:56:05 CDT 2012


Wouldn't a combination of to_days(date) en from_days(ulong) help ? 
Using from_days(some number equal to the date you need) is always correct no matter what date time format is used.
This is what we did when trying to escape hardcoding dates.

hth 

-- 
Bart Pietercil
CTO Cognosis NV
Dorpstraat 28
3560 Lummen


On Thursday 28 June 2012 at 14:47, jda wrote:

> 
> > > >      dateAdded > datediff( now(), '01/01/1904 00:00:00', 'second' ) - (14 * 24 * 60 * 60) 
> > > 
> 
> 
> > > Hi Ivan,
> > > 
> > > But that's not the problem. It works just fine form my purposes (local time). The problem is the format for the date parameter:
> > > 
> > >      01/01/1904
> > > 
> > > works if the system language (international setting) is set to English.
> > > 
> > > It fails if the language is set to German. I thought
> > > 
> > >      01-01-1904
> > > 
> > > would work, but the search -> no results (there should be many when the language is German (or English).
> > > 
> > > This is all on the same Mac in one time zone, there there should be no issues with now().
> > > 
> > 
> > Hi Jon,
> > 
> > Actually, it is not related to the language - it is only related to the date-time format property.
> > And so, if user can set any format himself you can not hardcoded date literals in your queries.
> > 
> 
> Thanks. It would help if I knew what the possibilities are, though. I can document this for my users. For example, what would you use for such a query in Ukraine? What about a romance language or other European languages? There can't be too many variations.
> 
> Ruslan had suggested
> 
> 01-01-1904
> 
> but that doesn't work. Or do I also have to put the parameter 'second' in the language selected by the user?
> 
> Jon
> 
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net (mailto:Valentina at lists.macserve.net)
> http://lists.macserve.net/mailman/listinfo/valentina
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120628/822b925b/attachment-0001.html>


More information about the Valentina mailing list