I
Ian
I have a problem I hope someone can point out where I am going wrong. I need
to store a date/time in a cookie ( ie the date a visitor last visited )
However the date format changes to US, despite LCID being set to UK. I have
googled extensively but can't work it out.
This is my code to give write the current date/time to screen:
<%
Session.LCID = 2057
Response.Write Now() & "<br>" &
Response.Write FormatDateTime(Now(),1)
%>
This produces the following in the browser as I would expect
02/04/2004 15:13:48
02 April 2004
However when I store the date/time in a cookie, then read it back in it
changes to US format
My code:
<%
Session.LCID = 2057
'store date in cookie
Response.Cookies("Visit")("LastVist") = Now()
Response.Cookies("Visit").Expires = DateAdd("yyyy", 1, Now())
'read date back in and write it to browser
Response.Write Request.Cookies("Visit")("LastVist") & "<br>" &
Response.Write FormatDateTime(Request.Cookies("Visit")("LastVist"),1)
%>
I would expect this to give the same result as above, before it was written
to the cookie, but it doesn't it gives :
4/2/2004 3:13:48PM
04 February 2004
Any ideas? Many thanks if you can help.
to store a date/time in a cookie ( ie the date a visitor last visited )
However the date format changes to US, despite LCID being set to UK. I have
googled extensively but can't work it out.
This is my code to give write the current date/time to screen:
<%
Session.LCID = 2057
Response.Write Now() & "<br>" &
Response.Write FormatDateTime(Now(),1)
%>
This produces the following in the browser as I would expect
02/04/2004 15:13:48
02 April 2004
However when I store the date/time in a cookie, then read it back in it
changes to US format
My code:
<%
Session.LCID = 2057
'store date in cookie
Response.Cookies("Visit")("LastVist") = Now()
Response.Cookies("Visit").Expires = DateAdd("yyyy", 1, Now())
'read date back in and write it to browser
Response.Write Request.Cookies("Visit")("LastVist") & "<br>" &
Response.Write FormatDateTime(Request.Cookies("Visit")("LastVist"),1)
%>
I would expect this to give the same result as above, before it was written
to the cookie, but it doesn't it gives :
4/2/2004 3:13:48PM
04 February 2004
Any ideas? Many thanks if you can help.