# DayOfYear

Returns the current day of year.

## Syntax

```typescript
DayOfYear(): number
```

## Return Value

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

## Description

The `DayOfYear` method returns the day of the year for the current time. The returned value is between 1 and 366 (for leap years).

## Example

```typescript
// Get current day of year
const dayOfYear = this.api.DayOfYear()
console.log(`Current day of year: ${dayOfYear}`)

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

// Calculate percentage of year completed
const percentComplete = (dayOfYear / daysInYear) * 100
console.log(`Year is ${percentComplete.toFixed(1)}% complete`)

// Check for quarter boundaries
const quarterBoundaries = [1, 91, 182, 274]
const isQuarterStart = quarterBoundaries.includes(dayOfYear)
if (isQuarterStart) {
    console.log('Start of a new quarter')
}

// Calculate week number
const weekNumber = Math.ceil(dayOfYear / 7)
console.log(`Current week of year: ${weekNumber}`)
```
