Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format date

Status
Not open for further replies.

Wissam

Vendor
Aug 21, 2002
10
ES
i want to obtain the date in the format dd/mm/yy. but i could not find a vbscript fucntion or code that would do that. Could any one help?

Thanks
 
You use the formatdatetime() function to specify the date in long or short form. However, the long or short form displayed depends on the set up of your webserver.

To display the date in short form, use the following:

formatdatetime(mydate, 2)

If this does not display the date in the desired format then you need to change the short date format on your webserver. If you do not have control of the webserver, then a simple alternative is to do the following:

day(myDate) & "/" & month(myDate) & "/" & mid(year(myDate),3)

That will give you a string in the form dd/mm/yy

Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top