# Class DateUtils

## Index

### Methods

- convertToStandardDate
- dateForQuery
- dateTimeForQuery
- dateTimeToString
- dateToString
- isValid
- keepOnlyDatePart
- monthToString
- offsetDateByDays
- timeBetween
- timeToString

## Methods

### Static convertToStandardDate

- convertToStandardDate(date: any): Date

- - Defined in utils/DateUtils.ts :199

  #### Parameters

  - ##### date: any

  #### Returns Date

  The parsed Date object, or `Invalid Date` if the `date` argument was not recognized as a valid date.

### Static dateForQuery

- dateForQuery(date: Date): string

- - Defined in utils/DateUtils.ts :233

  #### Parameters

  - ##### date: Date

  #### Returns string

  A string corresponding to the `date` argument value, in the `YYYY/MM/DD` format.

### Static dateTimeForQuery

- dateTimeForQuery(date: Date): string

- - Defined in utils/DateUtils.ts :244

  #### Parameters

  - ##### date: Date

  #### Returns string

  A string corresponding to the `date` argument value, in the `YYYY/MM/DD@HH:mm:ss` format.

### Static dateTimeToString

- dateTimeToString(date: Date, options?: IDateToStringOptions): string

- - Defined in utils/DateUtils.ts :397

  #### Parameters

  - ##### date: Date

  - ##### Optional options: IDateToStringOptions

  #### Returns string

  A date string corresponding to the `date` argument value, formatted according to the specified `options`.

### Static dateToString

- dateToString(date: Date, options?: IDateToStringOptions): string

- - Defined in utils/DateUtils.ts :319

  #### Parameters

  - ##### date: Date

  - ##### Optional options: IDateToStringOptions

  #### Returns string

  A date string corresponding to the `date` argument value, formatted according to the specified `options`.

### Static isValid

- isValid(date: any): boolean

- - Defined in utils/DateUtils.ts :460

  #### Parameters

  - ##### date: any

  #### Returns boolean

  `true` if the `date` argument is an instance of Date; `false` otherwise.

### Static keepOnlyDatePart

- keepOnlyDatePart(date: Date): Date

- - Defined in utils/DateUtils.ts :255

  #### Parameters

  - ##### date: Date

  #### Returns Date

  A cropped Date object corresponding to the `date` argument value, excluding its time information.

### Static monthToString

- monthToString(month: number): string

- - Defined in utils/DateUtils.ts :449

  #### Parameters

  - ##### month: number

  #### Returns string

  A string whose value is the localized name of the corresponding `month`.

### Static offsetDateByDays

- offsetDateByDays(date: Date, offset: number): Date

- - Defined in utils/DateUtils.ts :267

  #### Parameters

  - ##### date: Date

  - ##### offset: number

  #### Returns Date

  An offset Date object corresponding to the `date` argument value plus the `offset` value.

### Static timeBetween

- timeBetween(from: Date, to: Date): string

- - Defined in utils/DateUtils.ts :476

  #### Parameters

  - ##### from: Date

  - ##### to: Date

  #### Returns string

  A string whose value corresponds to the amount of time between `from` and `to`, or an empty string if either argument was undefined.

### Static timeToString

- timeToString(date: Date, options?: IDateToStringOptions): string

- - Defined in utils/DateUtils.ts :381

  #### Parameters

  - ##### date: Date

  - ##### Optional options: IDateToStringOptions

  #### Returns string

  A string containing the time information of the `date` argument, and formatted according to the specified `options`.

### Hierarchy

- DateUtils