# GetMonthByDateTime

Returns the month from an FTODate object.

## Syntax

```typescript
GetMonthByDateTime(ftoDate: FTODate): number
```

## Parameters

* `ftoDate`: [`FTODate`](https://fto-2.gitbook.io/fto-strategies-docs/strategies/fto-date) - The FTODate object to extract the day from

## Return Value

Returns a `number` representing the month (1-12).

## Description

The `GetMonthByDateTime` method extracts the month from an [`FTODate`](https://fto-2.gitbook.io/fto-strategies-docs/strategies/fto-date) object. The returned value is between 1 and 12, where 1 represents January and 12 represents December.

## Example

```typescript
// Create FTODate object
const currentDate = this.api.TimeCurrent();
const month = this.api.GetMonthByDateTime(currentDate);
console.log(`Month: ${month}`);

// Format with leading zero
const formattedMonth = month.toString().padStart(2, "0");
console.log(`Formatted month: ${formattedMonth}`);

// Get month name
const monthNames = [
  "January",
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December",
];
console.log(`Month name: ${monthNames[month - 1]}`);

// Check for quarter end
const isQuarterEnd = month % 3 === 0;
console.log(`Is quarter end: ${isQuarterEnd}`);

// Format full date
const year = currentDate.yearOf();
const day = currentDate.dayOfMonth();
console.log(`Date: ${year}.${formattedMonth}.${day}`);
```
