// Date Example
/* Date returns current system date */
var dt = new Date();
var dd = dt.getDate();
var mm = dt.getMonth()+1;
var yyyy = dt.getYear()+1900;
var Today = mm + '/' + dd + '/' + yyyy;
NSB.Print(Today);
Add javascript snippet |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
Date returns the current system date. | Date returns the current system date. | ||
== Example | == Example == | ||
< | <tabber> | ||
JavaScript= | |||
<syntaxhighlight lang="JavaScript"> | |||
< | |||
= | |||
// Date Example | // Date Example | ||
/* Date returns current system date */ | /* Date returns current system date */ | ||
Line 23: | Line 16: | ||
var dd = dt.getDate(); | var dd = dt.getDate(); | ||
var mm = dt.getMonth()+1; | var mm = dt.getMonth()+1; | ||
var | var yyyy = dt.getYear()+1900; | ||
var Today = mm + '/' + dd + '/' + | var Today = mm + '/' + dd + '/' + yyyy; | ||
NSB.Print(Today); | NSB.Print(Today);</syntaxhighlight> | ||
</ | |-| | ||
BASIC= | |||
<syntaxhighlight lang="vb.net"> | |||
Rem Date Example | |||
'Date returns current system date | |||
Dim Today | |||
Today = Date | |||
Print "Today is " & Today | |||
</syntaxhighlight> | |||
</tabber> | |||
== Output == | == Output == |
Date
Date returns the current system date.
// Date Example
/* Date returns current system date */
var dt = new Date();
var dd = dt.getDate();
var mm = dt.getMonth()+1;
var yyyy = dt.getYear()+1900;
var Today = mm + '/' + dd + '/' + yyyy;
NSB.Print(Today);
Rem Date Example
'Date returns current system date
Dim Today
Today = Date
Print "Today is " & Today
Today is 8/18/1998 (sample date output is system dependant)