p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Re: Date formatting


Message #1 by "Ken Schaefer" <ken@a...> on Tue, 4 Jun 2002 15:49:09 +1000
Set the Session.LCID to be whatever you need it to be.

<%
Session.LCID = ...
%>

There's a list here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q229690

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Easwar K.P." <easwarkp@v...>
Subject: [asp_databases] Date formatting


I have this problem when i try to use date in VB Script. I am using a
calender developed in VB script to let the user pick dates. I require the
calender for a month to be popped up based on date value from the database.
(Currently SQLServer 2000) The date format in DB is in "dd/mm/yy" format. My
requirement is to get the day of week for a given date.

For eg. 01/06/2002 (2nd June 2002)should give me "Saturday".

But I see that this depends on the date setting of the webserver - (script
environment) if the date setting there is "mm/dd/yy" the date I give as
01/06/2002 is interpreted as 06-Jan-2002 which is a "Sunday"

To overcome this I query a known date - in my case 12/06/1996  and find what
week day it is. From that I am get the date setting of the script
environment. If the weekday returned is "Wednesday" then it is "dd/mm/yy"
format and if it is "Thursday" the date format is "mm/dd/yy".

But I am sure there is a better way to do this......... Could someone help?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #2 by "Easwar K.P." <easwarkp@v...> on Tue, 4 Jun 2002 08:37:01 +0530
This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C20BA2.FF3EABE0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hi,

I have this problem when i try to use date in VB Script. I am using a 
calender developed in VB script to let the user pick dates. I require 
the calender for a month to be popped up based on date value from the 
database. (Currently SQLServer 2000) The date format in DB is in 
"dd/mm/yy" format. My requirement is to get the day of week for a given 
date.

For eg. 01/06/2002 (2nd June 2002)should give me "Saturday".

But I see that this depends on the date setting of the webserver - 
(script environment) if the date setting there is "mm/dd/yy" the date I 
give as 01/06/2002 is interpreted as 06-Jan-2002 which is a "Sunday"

To overcome this I query a known date - in my case 12/06/1996  and find 
what week day it is. From that I am get the date setting of the script 
environment. If the weekday returned is "Wednesday" then it is 
"dd/mm/yy" format and if it is "Thursday" the date format is "mm/dd/yy". 


But I am sure there is a better way to do this......... Could someone 
help?

Thanks in advance...

easwar




  Return to Index