# TimeDayOfYear

Returns the day of year from a Unix timestamp.

## Syntax

```typescript
TimeDayOfYear(unixTimeSeconds: number): number
```

## Parameters

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

## Return Value

Returns a `number` representing the day of year (1-366).

## Description

The `TimeDayOfYear` method extracts the day of year from a given Unix timestamp. The returned value is between 1 and 366 (for leap years).

## Example

```typescript
// Get day of year for a timestamp
const timestamp = 1707739200; // 2024.02.12 12:00:00 UTC
const dayOfYear = this.api.TimeDayOfYear(timestamp);
console.log(`Day of year: ${dayOfYear}`);

// Calculate days remaining in the year
const daysInYear =
  this.api.TimeToStruct(timestamp).yearOf() % 4 === 0 ? 366 : 365;
const daysRemaining = daysInYear - dayOfYear;
console.log(`Days remaining: ${daysRemaining}`);

// Calculate percentage of year completed
const percentComplete = (dayOfYear / daysInYear) * 100;
console.log(`Year progress: ${percentComplete.toFixed(2)}%`);

// Check if it's a quarter boundary
const isQuarterEnd =
  dayOfYear === 90 ||
  dayOfYear === 181 ||
  dayOfYear === 273 ||
  dayOfYear === 365;
console.log(`Is quarter end: ${isQuarterEnd}`);
```
