Date: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
JwellsNB (talk | contribs)
Add javascript snippet
Line 5: Line 5:
Date returns the current system date.
Date returns the current system date.


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


<pre>
<pre>
Line 13: Line 13:
Today = Date
Today = Date
Print "Today is " & Today
Print "Today is " & Today
</pre>
== Example (JavaScript) ==
<pre>
// Date Example
/* Date returns current system date */
var dt = new Date();
var dd = dt.getDate();
var mm = dt.getMonth()+1;
var yy = dt.getYear()+1900;
var Today = mm + '/' + dd + '/' + yy;
NSB.Print(Today);
</pre>
</pre>



Revision as of 18:12, 26 May 2013

Date

Description

Date returns the current system date.

Example (Basic)

Rem Date Example
'Date returns current system date
Dim Today
Today = Date
Print "Today is " & Today

Example (JavaScript)

// Date Example
/* Date returns current system date */

var dt = new Date();
var dd = dt.getDate();
var mm = dt.getMonth()+1;
var yy = dt.getYear()+1900;
var Today = mm + '/' + dd + '/' + yy;
NSB.Print(Today);

Output

Today is 8/18/1998
(sample date output is system dependant)

Related Items

Now, Time