web 2.0

ASP/VBScript FormatDateTime()

ASP/VBScript FormatDateTime() Returns an expression formatted as a date or time.

ShotDev Focus:
- Using Asp and FormatDateTime() function.

Syntax


<%
FormatDateTime(Date[, NamedFormat])
%>

DateFormat
0 System Settings
1 Format (Ex : Saturday, June 26, 1943)
2 Format (Ex : 09/09/2008)
3 Format (Ex : 13:34:00)
4 Format (Ex : 13:34)

Example

asp_formatdatetime.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Response.write FormatDateTime("09/01/2010",0)&"<br>"
Response.write FormatDateTime("13:34:00",3)&"<br>"
Response.write FormatDateTime("13:34:00",4)&"<br>"
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_formatdatetime.asp

Screenshot

ASP/VBScript & FormatDateTime()

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.