Last post May 14, 2007 05:21 AM by lucasbfr
Feb 06, 2007 01:49 AM|louen84|LINK
i just finish a web app on my local pc and the date format was in (dd/mm/yyyy hh:mm:ss AM/PM) but when i port them over to my web server the date format changed to (dd-MMM-yy hh:mm:ss AM/PM).
As my validators checks for the format entered by users , since the format changed, my validator no longer worked. Is there anyway to change back the date format to the original (dd/mm/yyyy hh:mm:ss AM/PM) ? Is there a setting in the webserver where i can
tweak the time format?( Other apps running on my server were displaying date format of dd-mm-yyyy).
Would appreciate any pros to look into this for me. Thanks a million.
Feb 08, 2007 12:21 AM|aweil|LINK
What happens is that the Web server is configured with a different language than your machine. ASP.net run by default with the timezone of the machine, but you can change this.
Go to your Web.config file, and add a <globalization> element under the <system.web> one, so that it looks that way (replace "fr-FR" with whatever you want the culture to be):
<globalization culture="fr-FR" uiCulture="fr-FR"/>
That way it will run equally on both your machine and the server.
Feb 08, 2007 04:27 AM|louen84|LINK
on changing the date time globally, i'm able to insert the date into access database but when i attempt to select with the changed date format using <globalization culture="en-GB"
uiCulture="en-GB"/> it returns nothing, but if i select with the default date format it returns with data selected. Do i have to somehow change the database date format as well? i was wondering why when i could insert a changed
date format but could not select with it...
Feb 08, 2007 11:07 AM|aweil|LINK
Normally, a different database language should be compatible with your application.
What may be wrong from your description is the SQL query you use to selec the date from the database. If using SQL Server, the condition should be of the form (more or less):
"SELECT date where date < %2005-05-12%"
Can you post your SQL query, if you still have a problem?
May 14, 2007 05:21 AM|lucasbfr|LINK