Year: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "YEAR(''date'') '''Description''' YEAR returns an integer, that represents the year of the given date.The required parameter, ''date'', can be any expression that represents ...")
 
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
YEAR(''date'')
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
Year(''date'')


YEAR returns an integer, that represents the year of the given date.The required parameter, ''date'', can be any expression that represents a date.
== Description ==


'''Example'''
Year returns an integer, that represents the year of the given date.The required parameter, ''date'', can be any expression that represents a date.
 
== Example (Basic) ==


<pre>
<pre>
REM YEAR Example
Rem Year Example
'YEAR returns year of a date as an integer
'Year returns year of a date as an integer
DIM IndepYear, Birthyear
 
IndepYear = YEAR("July 4, 1776")
Dim IndepYear, Birthyear
PRINT "YEAR of July 4, 1776:", IndepYear
IndepYear = Year("July 4, 1776")
Birthyear = YEAR("12/27/70")
Print "YEAR of July 4, 1776:", IndepYear
PRINT "YEAR of 12/27/70:", Birthyear
Birthyear = Year("12/27/70")
Print "YEAR of 12/27/70:", Birthyear
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
YEAR of July 4, 1776:     1776
YEAR of July 4, 1776: 1776
YEAR of 12/27/70:   1970
YEAR of 12/27/70: 1970
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[day|Day]], [[hour|Hour]], [[minute|Minute]], [[month|Month]], [[now|Now]], [[second|Second]], [[time|Time]]
 
[[Category:Language Reference]]
 
[[Category:Date and Time]]


[[day|DAY]], [[hour|HOUR]], [[minute|MINUTE]], [[month|MONTH]], [[now|NOW]], [[second|SECOND]], [[time|TIME]]
[[Category:BASIC Functions]]

Latest revision as of 15:40, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Year(date)

Description

Year returns an integer, that represents the year of the given date.The required parameter, date, can be any expression that represents a date.

Example (Basic)

Rem Year Example
'Year returns year of a date as an integer

Dim IndepYear, Birthyear
IndepYear = Year("July 4, 1776")
Print "YEAR of July 4, 1776:", IndepYear
Birthyear = Year("12/27/70")
Print "YEAR of 12/27/70:", Birthyear

Output

YEAR of July 4, 1776: 1776
YEAR of 12/27/70: 1970

Related Items

Day, Hour, Minute, Month, Now, Second, Time