ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Formatting date/time in ASP

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
jon



Joined: 01 Oct 2004
Posts: 40

PostPosted: Thu Oct 21, 2004 12:12 pm    Post subject: Formatting date/time in ASP Reply with quote

Hi,

I'm extracting several values from my Access database and one of them is storing date/time value. Is there a way to display this date/time value in different formats on my ASP page. Is there an ASP date/time formatting function?



jon
Back to top
View user's profile Send private message
pepper



Joined: 10 Oct 2004
Posts: 5

PostPosted: Thu Oct 21, 2004 1:48 pm    Post subject: Reply with quote

Hey Jon,

There is a VBScript function called FormatDateTime, which you can use to format the date field in your ASP page. Here is how to use it:

Code:
strTime = FormatDateTime("10/21/2004", vbGeneralDate)


There are 5 constants that you can use as a second parameter of the function (vbGeneralDate, vbLongDate, vbShortDate, vbLongTime, vbShortTime).

I hope this helps.
_________________
Hot Pepper :/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial