Skip to content

Type Alias: DatePartsType ​

ts
type DatePartsType = object;

Type representing the parts of a date.

Example ​

ts
const dateParts: DatePartsType = {
  year: 2023,
  month: 8,
  day: 1,
  hour: 12,
  minute: 0,
  second: 0,
  timestamp: 1693456000000
};
console.log(dateParts); //output: { year: 2023, month: 8, day: 1, hour: 12, minute: 0, second: 0, timestamp: 1693456000000 }

Properties ​

day ​

ts
day: number;

The day of the date (1-31).


hour ​

ts
hour: number;

The hour of the date (0-23).


minute ​

ts
minute: number;

The minute of the date (0-59).


month ​

ts
month: number;

The month of the date (1-12).


second ​

ts
second: number;

The second of the date (0-59).


timestamp ​

ts
timestamp: number;

The timestamp of the date in milliseconds.


year ​

ts
year: number;

The year of the date.