Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation ASP returns dayname in Italian !

    Hi,

    When i used to call date function in ASP it used to return them in English but now it has decided to return them in Italian.

    Im not sure what has happend for it to to do this but can anyone help?

    Thanks.

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Check your Session.LCID or the Regional Settings on your server.

    If either of them is in Italian, then ASP's DATE() will return Italian text.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Perfect ! GMT time ?

    Perfect. Thanks very much, youve just saved me alot of hasstle.

    Now im wondering that if i change the LCID to eg. England would the time be returned in GMT ? or is there any easy way of doing that?

    Thanks again.


  • #4
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Yes, but you would also be returning the dates in dd/mm/yyyy format.

    Your currency would also be in UK pounds, not US dollars.

    A PITA way is below (thank you to aspfaq.com for this code):

    Code:
    <% 
        ' fill in your known bias here! 
     
        offset = 5     'This is how many hours off GMT you are. EST is 5, CST 6, etc.
     
        ' tell us what date you want 
     
        od = "2005-02-01 5:32 AM"     'Can be dynamically placed.
     
        ' find first Sunday in April         'for below, don't forget that DST has changed for 2007
     
        for i = 1 to 7 
            if weekday("4/" & i & "/" & year(d))=1 then 
                startDST = cdate("4/" & i & "/" & year(d)) 
                exit for 
            end if 
        next 
     
        ' find last Sunday in October 
     
        for i = 31 to 25 step -1 
            if weekday("10/" & i & "/" & year(d))=1 then 
                endDST = cdate("10/" & i & "/" & year(d)) 
                exit for 
            end if 
        next 
     
        ' subtract hour from offset if within DST 
     
        if cdate(od) >= startDST and cdate(od) < endDST then 
            offset = offset - 1 
        end if 
     
        nd = dateadd("h", offset, od) 
         
        Response.Write("Current = " & od & "<Br>UTC = " & nd) 
    %>
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #5
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Great thats give me the basis of a great start.

    Great help !


  •  

    Posting Permissions

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