DateSerial: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
DateSerial(''year'', ''month'', ''day'')
DateSerial(''year'', ''month'', ''day'')


Line 5: Line 7:
DateSerial returns a date constructed from a given year, month, and day. The required parameter, ''year'', is any numeric expression ranging from 100 to 9999. The required parameters, ''month'' and ''day'', can be any numeric expression.
DateSerial returns a date constructed from a given year, month, and day. The required parameter, ''year'', is any numeric expression ranging from 100 to 9999. The required parameters, ''month'' and ''day'', can be any numeric expression.


== Example ==
== Example (Basic) ==


<pre>
<pre>
REM DateSerial Example
Rem DateSerial Example
'DateSerial builds a date from its parts
'DateSerial builds a date from its parts
DIM IndepDay, Birthday
Dim IndepDay, Birthday
IndepDay = DateSerial(1776, 7, 4)
IndepDay = DateSerial(1776, 7, 4)
Birthday = DateSerial(1970, 12, 27)
Birthday = DateSerial(1970, 12, 27)
PRINT "Independence Day:", IndepDay
Print "Independence Day:", IndepDay
PRINT "My birthday:", Birthday
Print "My birthday:", Birthday
</pre>
</pre>


Line 27: Line 29:
== Related Items ==
== Related Items ==


[[timeserial|TIMESERIAL]]
[[timeserial|TimeSerial]]


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Date and Time]]
[[Category:BASIC Functions]]

Latest revision as of 15:22, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

DateSerial(year, month, day)

Description

DateSerial returns a date constructed from a given year, month, and day. The required parameter, year, is any numeric expression ranging from 100 to 9999. The required parameters, month and day, can be any numeric expression.

Example (Basic)

Rem DateSerial Example
'DateSerial builds a date from its parts
Dim IndepDay, Birthday
IndepDay = DateSerial(1776, 7, 4)
Birthday = DateSerial(1970, 12, 27)
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'')

Related Items

TimeSerial