# FTODate

The `FTODate` class provides comprehensive date and time manipulation functionality, with support for different time zones and time units.

## Methods

| Method                                              | Description                                              | Return Value                           |
| --------------------------------------------------- | -------------------------------------------------------- | -------------------------------------- |
| valueOf(timeUnit = TimeUnit.MILLISECONDS)           | Gets the timestamp value in specified time unit          | `number` - Timestamp in specified unit |
| toMilliseconds(timeZoneMode = TimeZoneMode.PROJECT) | Converts the date to milliseconds in specified timezone  | `number` - Milliseconds since epoch    |
| toSeconds(timeZoneMode = TimeZoneMode.PROJECT)      | Converts the date to seconds in specified timezone       | `number` - Seconds since epoch         |
| toString(timeZoneMode = TimeZoneMode.PROJECT)       | Converts the date to ISO string in specified timezone    | `string` - ISO formatted date string   |
| toJSDate(timeZoneMode = TimeZoneMode.PROJECT)       | Converts to JavaScript Date object in specified timezone | `Date` - JavaScript Date object        |
| dayOfMonth(timeZoneMode = TimeZoneMode.PROJECT)     | Gets the day of month (1-31)                             | `number` - Day of month                |
| monthOf(timeZoneMode = TimeZoneMode.PROJECT)        | Gets the month (1-12)                                    | `number` - Month number                |
| weekOf(timeZoneMode = TimeZoneMode.PROJECT)         | Gets the week number of the year                         | `number` - Week number                 |
| yearOf(timeZoneMode = TimeZoneMode.PROJECT)         | Gets the year                                            | `number` - Full year                   |
| dayOfYear(timeZoneMode = TimeZoneMode.PROJECT)      | Gets the day of year (1-366)                             | `number` - Day of year                 |
| dayOfWeek(timeZoneMode = TimeZoneMode.PROJECT)      | Gets the day of week (0-6, 0=Sunday)                     | `number` - Day of week                 |
| hour(timeZoneMode = TimeZoneMode.PROJECT)           | Gets the hour (0-23)                                     | `number` - Hour                        |
| minute(timeZoneMode = TimeZoneMode.PROJECT)         | Gets the minute (0-59)                                   | `number` - Minute                      |
| second(timeZoneMode = TimeZoneMode.PROJECT)         | Gets the second (0-59)                                   | `number` - Second                      |

## Example Usage

```typescript
// Create FTODate instance
const date = this.api.createFTODate(1707739200); // 2024.02.12 12:00:00 UTC

// Get components in project timezone
console.log(`Year: ${date.yearOf()}`);
console.log(`Month: ${date.monthOf()}`);
console.log(`Day: ${date.dayOfMonth()}`);
console.log(`Hour: ${date.hour()}`);
console.log(`Minute: ${date.minute()}`);
console.log(`Second: ${date.second()}`);

// Get components in UTC
console.log(`UTC Year: ${date.yearOf(TimeZoneMode.UTC)}`);
console.log(`UTC Month: ${date.monthOf(TimeZoneMode.UTC)}`);

// Convert to different formats
console.log(`Milliseconds: ${date.toMilliseconds()}`);
console.log(`Seconds: ${date.toSeconds()}`);
console.log(`ISO String: ${date.toString()}`);
console.log(`JS Date: ${date.toJSDate()}`);

// Get calendar information
console.log(`Day of Week: ${date.dayOfWeek()}`); // 0=Sunday
console.log(`Day of Year: ${date.dayOfYear()}`);
console.log(`Week of Year: ${date.weekOf()}`);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fto-2.gitbook.io/fto-indicators-docs/fto-date.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
