DateSerial: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
m Ghenne moved page Dateserial to DateSerial
JwellsNB (talk | contribs)
Add javascript snippet
Line 5: Line 5:
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>
Line 15: Line 15:
Print "Independence Day:", IndepDay
Print "Independence Day:", IndepDay
Print "My birthday:", Birthday
Print "My birthday:", Birthday
</pre>
== Example (JavaScript) ==
<pre>
// DateSerial Example
/* DateSerial builds a date from its parts */
var IndepDay, Birthday;
IndepDay = new Date(1776, 7-1, 4)
Birthday = new Date(1970, 12-1, 27)
NSB.Print( "Independence Day: " + IndepDay);
NSB.Print( "My birthday: " + Birthday);
</pre>
</pre>



Revision as of 17:41, 27 May 2013

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

Example (JavaScript)

// DateSerial Example
/* DateSerial builds a date from its parts */

var IndepDay, Birthday;
IndepDay = new Date(1776, 7-1, 4)
Birthday = new Date(1970, 12-1, 27)
NSB.Print( "Independence Day: " + IndepDay);
NSB.Print( "My birthday: " + Birthday);

Output

Independence Day:    7/4/1776
My birthday:  12/27/1970
(''sample date output is machine dependant'')

Related Items

TimeSerial