You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

A datetime's day of the week.

DayOfWeek = SRP_DateTime("DayOfWeek", Datetime)

Returns

An integer between 1 and 7: 1 = Monday, 7 = Sunday.

Parameters

ParameterDescription
DatetimeA datetime in OI internal format. (REQUIRED)

Remarks

The "DayOfWeek" service returns the day of the week component of an OI datetime, which is assumed to be in OI's internal format. The day of the week is returned as an integer between 1 and 7, with 1 being Monday and 7 being Sunday. For example, if an OI datetime represents March 30, 1978 at 12:41:08 pm, this service would return 4, since that datetime falls on a Thursday. If the given datetime is not valid, "" is returned.

Examples

// Get today's day of the week
DayOfWeek = SRP_DateTime("DayOfWeek", DateTime())

// Get today's day of the week in UTC
DayOfWeek = SRP_DateTime("DayOfWeek", SRP_DateTime("Today", 1))

// Get a hard coded date's day of the week
DayOfWeek = SRP_DateTime("DayOfWeek", -9519)

// Parse a date's day of the week
Datetime = SRP_Date("Parse", "Thursday, March 30, 1978", "DDD, MMMM D, YYYY")
DayOfWeek = SRP_DateTime("DayOfWeek", Datetime)
  • No labels