Creating a website for Spain

Discussion in 'ASP / ASP.net' started by Plastic Box, Feb 6, 2008.

  1. Plastic Box CSNM Customer

    Hi,

    I've made an ASP website for a Spanish audience that makes heavy use of the time. I'm aware in ASP that it uses the servers time, rather than the users computer time.

    I've tried setting the Locale to Spain, but it doesn't make a difference.

    Code:
    <%
    'Set the server locale
    Session.LCID = 3082
    %>
    How do I set the pages to follow Spanish time?

    Cheers
  2. Mark Voss CSNM Customer

    The locale only changes the format of the date, time, currency etc. it won't change the time to the local time of the locale you set it for.

    To display the local time you could just add the time difference (one hour?) to the server time using the DateAdd function:

    Code:
    DateAdd("h", 1, Now())
  3. Plastic Box CSNM Customer

    That makes sense - I've changed the date using that format, and it works just fine, thanks!

Share This Page