Weekday: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
WEEKDAY(''date''[, ''firstdayofweek''])
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
WeekDay(''date''[, ''firstdayofweek''])


== Description ==


WEEKDAY returns an integer representing the day of week from a given date. The required parameter, ''date'', is a numeric expression, a string expression, or any valid expression that can represent a date. The optional parameter, ''firstdayofweek'', is Sunday, if not specified. The return value is an integer from the table below.


For more information about firstdayofweek constants, see "Datediff".
WeekDay returns an integer representing the day of week from a given date. The required parameter, ''date'', is a numeric expression, a string expression, or any valid expression that can represent a date. The optional parameter, ''firstdayofweek'', is Sunday, if not specified. The return value is an integer from the table below.
 
For more information about firstdayofweek constants, see [[datediff|DateDiff]].


'''Table 26: WEEKDAY return values'''
'''Table 26: WEEKDAY return values'''
Line 29: Line 31:
|}
|}


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


<pre>
<pre>
REM WEEKDAY Example
Rem WeekDay Example
'WEEKDAY returns day of week as an integer
'WeekDay returns day of week as an integer
DIM IndepDay, Birthday
 
IndepDay = WEEKDAY("July 4, 1776")
Dim IndepDay, Birthday
PRINT "WEEKDAY of July 4, 1776:", IndepDay
IndepDay = WeekDay("July 4, 1776")
Birthday = WEEKDAY("12/27/70")
PRINT "Weekday of July 4, 1776:", IndepDay
PRINT "WEEKDAY of 12/27/70:", Birthday
Birthday = WeekDay("12/27/70")
PRINT "Weekday of 12/27/70:", Birthday
</pre>
</pre>


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


<pre>
<pre>
WEEKDAY of July 4, 1776:   5
Weekday of July 4, 1776: 5
WEEKDAY of 12/27/70:1
Weekday of 12/27/70: 1
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[weekdayname|WeekdayName]]
 
[[Category:Language Reference]]
 
[[Category:Date and Time]]


[[datediff|DATEDIFF]]
[[Category:BASIC Functions]]

Latest revision as of 15:39, 25 March 2019

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

WeekDay(date[, firstdayofweek])

Description

WeekDay returns an integer representing the day of week from a given date. The required parameter, date, is a numeric expression, a string expression, or any valid expression that can represent a date. The optional parameter, firstdayofweek, is Sunday, if not specified. The return value is an integer from the table below.

For more information about firstdayofweek constants, see DateDiff.

Table 26: WEEKDAY return values

Constant Value Description
vbSunday 1 Sunday
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

Example (Basic)

Rem WeekDay Example
'WeekDay returns day of week as an integer

Dim IndepDay, Birthday
IndepDay = WeekDay("July 4, 1776")
PRINT "Weekday of July 4, 1776:", IndepDay
Birthday = WeekDay("12/27/70")
PRINT "Weekday of 12/27/70:", Birthday

Output

Weekday of July 4, 1776: 5
Weekday of 12/27/70: 1

Related Items

WeekdayName