Skip to main content
Version: 20 R9

Day number

Day number ( aDate ) : Integer

ParameterTypeDescription
aDateDateDate for which to return the number
Function resultIntegerNumber representing the weekday on which date falls

Description

The Day number command returns a number representing the weekday on which aDate falls.Day number returns 2 for null dates.

4D provides the following predefined constants, found in the "Days and Months" theme:

ConstantTypeValue
SundayInteger1
MondayInteger2
TuesdayInteger3
WednesdayInteger4
ThursdayInteger5
FridayInteger6
SaturdayInteger7

Note: Day number returns a value between 1 and 7. To get the day number within the month for a date, use the command Day of.

Example

The following example is a function that returns the current day as a string:

 $viDay :=Day number(Current date) // $viDay gets the current day number
Case of
:($viDay =1)
0ドル:="Sunday"
:($viDay =2)
0ドル:="Monday"
:($viDay =3)
0ドル:="Tuesday"
:($viDay =4)
0ドル:="Wednesday"
:($viDay =5)
0ドル:="Thursday"
:($viDay =6)
0ドル:="Friday"
:($viDay =7)
0ドル:="Saturday"
End case

See also

Day of

Properties

Command number114
Thread safe

AltStyle によって変換されたページ (->オリジナル) /