locked
Web App Time format changed? RRS feed

  • Question

  • User-659716763 posted

    Hi all,

    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.

    Tuesday, February 6, 2007 1:49 AM

All replies

  • User764555827 posted

    Hi,

     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):

     

    <configuration>
        <system.web>
          <globalization culture="fr-FR" uiCulture="fr-FR"/>
        </system.web>
    </configuration>

     
    That way it will run equally on both your machine and the server.
    Best regards,

    Arnaud 

    Thursday, February 8, 2007 12:21 AM
  • User-659716763 posted

    Hi Arnaud,

    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...

    Thursday, February 8, 2007 4:27 AM
  • User764555827 posted

    Hi Louen,

    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?

    Best regards,

    Arnaud 

    Thursday, February 8, 2007 11:07 AM
  • User2091493147 posted
    Is there somewhere else you can change this? I am using this exact line (almost, got a <controls /> section before, and it doesn't seem to work on my user interface...
    Monday, May 14, 2007 5:21 AM