# TimeDayOfWeek

Returns the day of week from a Unix timestamp.

## Syntax

```typescript
TimeDayOfWeek(unixTimeSeconds: number): number
```

## Parameters

* `unixTimeSeconds`: `number` - Unix timestamp in seconds since epoch

## Return Value

Returns a `number` representing the day of week (0-6).

## Description

The `TimeDayOfWeek` method extracts the day of week from a given Unix timestamp. The returned value is between 0 and 6, where 0 represents Sunday and 6 represents Saturday.

## Example

```typescript
// Get day of week from timestamp
const timestamp = 1707739200; // 2024.02.12 12:00:00 UTC
const dayOfWeek = this.api.TimeDayOfWeek(timestamp);
console.log(`Day of week: ${dayOfWeek}`);

// Get day name
const dayNames = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday",
];
console.log(`Day name: ${dayNames[dayOfWeek]}`);

// Check for weekend
const isWeekend = dayOfWeek === 0 || dayOfWeek === 6;
console.log(`Is weekend: ${isWeekend}`);

// Calculate days until weekend
const daysUntilWeekend = dayOfWeek < 5 ? 5 - dayOfWeek : 6 - dayOfWeek + 5;
console.log(`Days until weekend: ${daysUntilWeekend}`);
```
