DateTime Compare using ISO Format

Posts   
 
    
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 20-Dec-2005 15:30:59   

I am developing in an environment that is using UK datetime format on the webserver, but American datetime format on the database. As you can imagine, this is causing problems. I can not change the setup of either in the immediate future so i am looking for workarounds.

The soluton is to use the "ISO DateTime format" as reccomended in the following article: http://www.4guysfromrolla.com/webtech/tips/t022202-1.shtml

So i gave this a go using the following predicate to construct my query:

PredicateFactory.CompareValue(ClubFieldIndex.LicenseToDate, ORM.ComparisonOperator.GreaterThan, DateTime.Today.ToString("yyyy-MM-dd"));

this results in the following SQL

SELECT ... WHERE ( [Club].[LicenseToDate] < 2005-12-20 ) 

However, this does not work because single quotes are needed round the date. So finally, my question is this:

Is there a way to force the ISO date output in the sql query to have single quotes? If not, does anyone have any other suggestions?

Thanks for any help

jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 20-Dec-2005 19:09:33   

Well, it turns out that the problem was elsewhere. The date compare seems to be working now. flushed