Skip to content
ChartDeck ChartScript docs Account Open the terminal

dayofweek

The day of the week of the bar open (dayofweek.sunday = 1, UTC). The dayofweek of a time in a time zone.

#Functions

#dayofweekfunction

The day of the week of the bar open (dayofweek.sunday = 1, UTC). The dayofweek of a time in a time zone.

dayofweek(time: int, { timezone?: string = "UTC" }): int
ParameterTypeDescription
timeintA time in milliseconds since 1970 (UTC).
timezonestringdefault "UTC"An IANA time zone such as "UTC" or "America/New_York".

Returns int.

Example

ChartScriptFragmentOpen in editor
const v = dayofweek(time, "UTC")

Since ChartScript 1

#Variables

#dayofweekvariable

The day of the week of the bar open (dayofweek.sunday = 1, UTC). The dayofweek of a time in a time zone.

dayofweek(time: int, { timezone?: string = "UTC" }): int

Type series int.

Example

ChartScriptFragmentOpen in editor
const v = dayofweek

Since ChartScript 1

#Constants

NameTypeDescription
dayofweek.fridayintFriday (6).
dayofweek.mondayintMonday (2).
dayofweek.saturdayintSaturday (7).
dayofweek.sundayintSunday (1).
dayofweek.thursdayintThursday (5).
dayofweek.tuesdayintTuesday (3).
dayofweek.wednesdayintWednesday (4).

The ChartScript documentation is in English for now; translations will follow.