DateValue: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
DateValue(''date'') | |||
== Description == | |||
DateValue returns a date. The required parameter, ''date'', is usually a string, but any expression that can represent a date, a time, or a date and time ranging from January 1, 100 to December 31, 9999, can be used. | |||
If date is a string that consists of numbers separated by date separators, it recognizes the order for month, day, and year according to the Short Date format specified for your system. If the year is left out of date, the current year is used. Unambiguous month names as strings will be recognized in either long or abbreviated form. | If date is a string that consists of numbers separated by date separators, it recognizes the order for month, day, and year according to the Short Date format specified for your system. If the year is left out of date, the current year is used. Unambiguous month names as strings will be recognized in either long or abbreviated form. | ||
Line 9: | Line 9: | ||
Date separators are characters that separate day, month, and year when a date is formatted as a string, they are determined by your system settings. | Date separators are characters that separate day, month, and year when a date is formatted as a string, they are determined by your system settings. | ||
== Example == | |||
<pre> | <pre> | ||
REM | REM DateValue Example | ||
' | 'DateValue returns a date | ||
DIM IndepDay, Birthday | DIM IndepDay, Birthday | ||
IndepDay = | IndepDay = DateValue("July 4, 1776") | ||
Birthday = | Birthday = DateValue("Dec 27 1970") | ||
PRINT "Independence Day:", IndepDay | PRINT "Independence Day:", IndepDay | ||
PRINT "My birthday:", Birthday | PRINT "My birthday:", Birthday | ||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Line 29: | Line 29: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[format|FORMAT]], [[timevalue|TIMEVALUE]] | [[format|FORMAT]], [[timevalue|TIMEVALUE]] | ||
[[Category:Language Reference]] |
Revision as of 20:48, 8 August 2012
DateValue(date)
Description
DateValue returns a date. The required parameter, date, is usually a string, but any expression that can represent a date, a time, or a date and time ranging from January 1, 100 to December 31, 9999, can be used.
If date is a string that consists of numbers separated by date separators, it recognizes the order for month, day, and year according to the Short Date format specified for your system. If the year is left out of date, the current year is used. Unambiguous month names as strings will be recognized in either long or abbreviated form.
Date separators are characters that separate day, month, and year when a date is formatted as a string, they are determined by your system settings.
Example
REM DateValue Example 'DateValue returns a date DIM IndepDay, Birthday IndepDay = DateValue("July 4, 1776") Birthday = DateValue("Dec 27 1970") PRINT "Independence Day:", IndepDay PRINT "My birthday:", Birthday
Output
Independence Day: 7/4/1776 My birthday: 12/27/1970 (''sample date output is machine dependant'')