Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Functions
FormatCurrency Function
FormatNumber Function
FormatPercent Function
FUNCTION: FormatDateTime( )
Implemented in version 2.0
FormatDateTime
(Date,
DateFormat
)
The
FormatDateTime
function formats dates and times. The output format is: MM/DD/YYYY
There is one mandatory argument.
Date
The
Date
argument is any valid date expression.
Code:
<% =FormatDateTime("6/26/43") %>
<% =FormatDateTime("15:34") %>
Output:
6/26/1943
3:34:00 PM
There is one optional argument.
DateFormat
The optional
DateFormat
argument must use the constant or value from the Date Format CONSTANTS.
CONSTANT
VALUE
DESCRIPTION
VBGeneralDate
0
Display the date and time using system settings
VBLongDate
1
Display the date in long date format
June 26, 1943
VBShortDate
2
Display the date in short date format
6/26/43
VBLongTime
3
Display the time in long time format
3:48:01 PM
VBShortTime
4
Display the time in short time format (24 hour clock)
15:48
Code:
<% =FormatDateTime("6/26/1943", 1) %>
<% =FormatDateTime("3:34:00 PM", 4) %>
Output:
Saturday, June 26, 1943
15:34
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information