Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: dates and uk / us format

  1. #1
    Join Date
    Jan 2006
    Posts
    419
    Thanks
    2
    Thanked 16 Times in 16 Posts

    Default dates and uk / us format

    Hi,

    Does anyone know how to configure a server so that an asp.net page returns date information in uk format without having to explicity specify the date should be uk format. Can it be done somewhere on the server or machine / web config files or similiar so that it is system wide.

    Thanks

    James

  2. #2
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by jimlewis
    Hi,

    Does anyone know how to configure a server so that an asp.net page returns date information in uk format without having to explicity specify the date should be uk format. Can it be done somewhere on the server or machine / web config files or similiar so that it is system wide.

    Thanks

    James
    Not sure with .NET, but the system regional settings controlled stuff like this in VBS/ASP.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    In .Net you set the Thread's CurrentCulture and CurrentUICulture.

    v1.1 Tutorial: http://www.dotnetjunkies.com/Tutoria...3D2EDD38B.dcik

    v2 Quickstart: http://samples.gotdotnet.com/quickst...alization.aspx

  4. #4
    Join Date
    Jan 2006
    Posts
    419
    Thanks
    2
    Thanked 16 Times in 16 Posts

    Default

    Cheers Sol for the solution - I guy at work stumbled on the same solution today. What was strange was the server always displayed UK dates and then a MS patch later US dates everywhere which was really annoying.

  5. #5
    Join Date
    Nov 2005
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    very powerfull option the localization with Culture and UICulture.
    I succeeded in making a complete multilangual website for a client of mine using the Culture Object and using it in the database.
    the culture is stored in a profile (which is also anonymous enabled)

    it's still in beta testing phase
    but you can check it here
    http://www.gedoptonline.be/Crasperformance/

  6. #6
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by psykik
    very powerfull option the localization with Culture and UICulture.
    I succeeded in making a complete multilangual website for a client of mine using the Culture Object and using it in the database.
    the culture is stored in a profile (which is also anonymous enabled)

    it's still in beta testing phase
    but you can check it here
    http://www.gedoptonline.be/Crasperformance/
    Interesting stuff, I have to do something similar with the new website... are you storing translations in the database?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  7. #7
    Join Date
    Nov 2005
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes I basically have to use 3 tables:

    example: for newsitems:
    I have the following tables
    News (with Id (identity), datestamp)
    News_LOCAL (with id, culture_id, title, content)
    Culture (id, culturename)


    news_local has a double primary key : id, culture_id

    and in my select statements all I have to do is request a parameter @culture which is stored in each visitors profile.
    profiles are easy to use since they accept anonymous access.



    as for the inserting and updating of data I have to use stored procedures so that for each entry different rows are written inside the _LOCAL tables.


    as for the static resources I simply use resourcefiles but I'm guessing you know how that works warren

    it's quite neat and it works very well... no need for querystrings ?language=.... in the url's


    :p

  8. #8
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Interesting way of doing it...

    For static resources I need to have it in an XML file that can be updated outside the application, works just as well with a nice helper class to handle it
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  9. #9
    Join Date
    Nov 2005
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Warren Ashcroft
    Interesting way of doing it...

    For static resources I need to have it in an XML file that can be updated outside the application, works just as well with a nice helper class to handle it
    aren't the generated resource files in xml format?
    I think yes.
    and you don't need to precompile them zo you can change them and upload them without putting the website offline first

  10. #10
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by psykik
    aren't the generated resource files in xml format?
    I think yes.
    and you don't need to precompile them zo you can change them and upload them without putting the website offline first
    But when you precompile the source for distribution (IE: I would never upload code to a server for security reasons), it becomes an issue...

    Besides, precompilation has various performance enhancements.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. XML/XSL date format
    By Rappie in forum XML
    Replies: 1
    Last Post: 27th July 2006, 12:10 PM
  2. Multiple dates
    By s80wkr in forum ASP (VBScript)
    Replies: 8
    Last Post: 18th October 2005, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •