Month: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
JwellsNB (talk | contribs)
Add javascript snippet
Line 5: Line 5:
Month returns a whole number ranging from 1 to 12 that represents the month of the year, of a given date.The required parameter, ''date'', can be any numeric or string expression, or any expression that represents a date.
Month returns a whole number ranging from 1 to 12 that represents the month of the year, of a given date.The required parameter, ''date'', can be any numeric or string expression, or any expression that represents a date.


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


<pre>
<pre>
Line 14: Line 14:
Print "The Month of " & When & " is " _  
Print "The Month of " & When & " is " _  
       & Month(When)
       & Month(When)
</pre>
== Example (JavaScript) ==
<pre>
// Month Example
/* Month returns month of year of a date */
var When;
When = new Date();
NSB.Print("The Month of " + When + " is " + (When.getMonths()+1))
</pre>
</pre>



Revision as of 02:13, 28 May 2013

Month(date)

Description

Month returns a whole number ranging from 1 to 12 that represents the month of the year, of a given date.The required parameter, date, can be any numeric or string expression, or any expression that represents a date.

Example (Basic)

Rem Month Example
'Month returns month of year of a date
Dim When
When = Now
Print "The Month of " & When & " is " _ 
       & Month(When)

Example (JavaScript)

// Month Example
/* Month returns month of year of a date */

var When;
When = new Date();
NSB.Print("The Month of " + When + " is " + (When.getMonths()+1))

Output

The Month of 8/18/1998 10:52:44 PM is 8
(sample date output is system dependant)

Related Items

Day, Hour, Minute, Now, Second, Time, Year