View Full Version : ASP returns dayname in Italian !
06-14-2007, 04:04 PM
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?
06-14-2007, 05:31 PM
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.
06-14-2007, 06:10 PM
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?
06-14-2007, 07:12 PM
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):
' 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))
' 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))
' subtract hour from offset if within DST
if cdate(od) >= startDST and cdate(od) < endDST then
offset = offset - 1
nd = dateadd("h", offset, od)
Response.Write("Current = " & od & "<Br>UTC = " & nd)
06-14-2007, 07:42 PM
Great thats give me the basis of a great start.
Great help !
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.