DateValue Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The DateValue function returns a type Date. The DateValue function converts an argument into the variant of subtype Date. Date can also be any expression that can represent a date, a time, or both a date and time, in that range. DateValue also recognizes clear dates that contain month names, either in long or abbreviated form.

Note :- If the year part of date is omitted this function will use the current year from the computer's system date.

Note :- If the date parameter includes time information it will not be returned. However, if date includes invalid time information, a run-time error will occur.


The Syntax of DateValue function is :-

DateValue(date)

Example#1 :-

Code :-
document.write(DateValue("31-Jan-02") & "<br />")
document.write(DateValue("31-Jan") & "<br />")
document.write(DateValue("31-Jan-02 2:39:49 AM"))
Output :-

1/31/2002
1/31/2002
1/31/2002

Example#2 :-

Code :-
<% mystring = "06/26/1943" %>
<% =DateValue(mystring) %>
Output :-
6/26/1943

Example#3 :-

Code :-
<% =DateValue("1/1/2001") %>
Output :-
1/1/2001

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641