// 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);
Created page with "DATE '''Description''' DATE returns the current system date. '''Example''' <pre> REM DATE Example 'DATE returns current system date DIM Today Today = DATE PRINT "Today is ..." |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Date | |||
== Description == | |||
Date returns the current system date. | |||
== Example == | |||
< | <tabber> | ||
JavaScript= | |||
' | <syntaxhighlight lang="JavaScript"> | ||
// Date Example | |||
Today = | /* 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);</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 == | |||
<pre> | <pre> | ||
Line 22: | Line 37: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[now|Now]], [[time|Time]] | |||
[[Category:Language Reference]] | |||
[[ | [[Category:Date and Time]] |
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)