Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Date format from one culture to another

Reply
Thread Tools

Date format from one culture to another

 
 
dotnettester
Guest
Posts: n/a
 
      09-08-2005
Hi,

I know how you can format date by describing culture info on ASP.net . How
can I do the same thing in classic ASP.

?
Tnx
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-08-2005
dotnettester wrote:
> Hi,
>
> I know how you can format date by describing culture info on ASP.net
> . How can I do the same thing in classic ASP.
>
> ?
> Tnx

http://www.aspfaq.com/show.asp?id=2260
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
 
Bullschmidt
Guest
Posts: n/a
 
      09-09-2005
To make a variable be in the format of mm/dd/yyyy (and the final line of
code can be modifed for other date formats), perhaps try something like
the following which you might even make into a function that you could
put on a page that gets included in your main pages:

varFld = CDate(MyVariable)

intMonth = Month(varFld)
intDay = Day(varFld)
intYr = Year(varFld)

If intMonth < 10 Then
strMonth = "0" & CStr(intMonth)
Else
strMonth = CStr(intMonth)
End If

If intDay < 10 Then
strDay = "0" & CStr(intDay)
Else
strDay = CStr(intDay)
End If

strYr = Right(CStr(intYr), 4) ' And change the 4 to 2 for 2 year dates.

varFld = CStr(strMonth & "/" & strDay & "/" & strYr)

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
I know how you can format date by describing culture info on ASP.net .
How can I do the same thing in classic ASP.
>>


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Rob Dob ASP .Net Web Controls 0 11-27-2005 03:57 PM
[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Rob Dob ASP .Net 0 11-27-2005 03:57 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Datagrid Column Date Format : Recognizes Browser Culture Rod Billett ASP .Net Datagrid Control 0 08-27-2003 04:19 PM
Re: Javascript: date in culture/language format. Vidar Petursson ASP .Net 0 08-15-2003 10:28 PM



Advertisments