# FormatDateTime

Formats a timestamp into a date/time string.

## Syntax

```typescript
FormatDateTime(value: number, mode: number = TIME_DATE | TIME_MINUTES): string
```

## Parameters

* `value`: `number` - The Unix timestamp to format
* `mode`: `number` - The format flags controlling the output

## Return Value

Returns a `string` representing the formatted date and/or time.

## Description

The `FormatDateTime` method converts a Unix timestamp into a formatted date/time string. The output format is controlled by the mode parameter, which can be a combination of the following flags:

```typescript
TIME_DATE = 1 // Include date component (YYYY.MM.DD)
TIME_MINUTES = 2 // Include time with minutes (HH:MM)
TIME_SECONDS = 4 // Include seconds (SS)
```

The flags can be combined using the bitwise OR operator (|) to get different combinations of components.

## Example

```typescript
const timestamp = 1707739200 // 2024.02.12 12:00:00 UTC

// Different format combinations
const dateOnly = this.api.FormatDateTime(timestamp, TIME_DATE)
// Returns "2024.02.12"

const dateAndTime = this.api.FormatDateTime(timestamp, TIME_DATE | TIME_MINUTES)
// Returns "2024.02.12 12:00"

const fullDateTime = this.api.FormatDateTime(timestamp, TIME_DATE | TIME_MINUTES | TIME_SECONDS)
// Returns "2024.02.12 12:00:00"

const timeOnly = this.api.FormatDateTime(timestamp, TIME_MINUTES)
// Returns "12:00"

const timeWithSeconds = this.api.FormatDateTime(timestamp, TIME_MINUTES | TIME_SECONDS)
// Returns "12:00:00"
```

## Format Specifications

1. Date format: "YYYY.MM.DD"
   * YYYY: 4-digit year
   * MM: 2-digit month (01-12)
   * DD: 2-digit day (01-31)
2. Time format: "HH:MM" or "HH:MM:SS"
   * HH: 2-digit hour (00-23)
   * MM: 2-digit minutes (00-59)
   * SS: 2-digit seconds (00-59) if TIME\_SECONDS flag is set
