Splits a FullDate up into multiple formatted string representations.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.
This uses numbers for everything.
A day of the month: 1-31 depending on the month
Hour of the day in 24 time: 0-23
Optional
millisecond?: null | numberMillisecond of the second: 0-999
Minute of the hour: 0-59
A month of the year: 1-12
The full, four digit year.
import {toDatePartStrings, utcTimezone} from 'date-vir';
let result = toDatePartStrings(
{
year: 2024,
month: 4,
day: 24,
hour: 6,
minute: 4,
second: 9,
millisecond: 123,
timezone: utcTimezone,
},
{includeSeconds: true},
);
// outputs:
result = {
date: '2024-04-24',
time: '06:04:09',
timezone: 'UTC',
};
Splits a FullDate up into multiple formatted string representations.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.
This uses numbers for everything.
A day of the month: 1-31 depending on the month
Hour of the day in 24 time: 0-23
Optional
millisecond?: null | numberMillisecond of the second: 0-999
Minute of the hour: 0-59
A month of the year: 1-12
Optional
second?: null | MinuteThe full, four digit year.
import {toDatePartStrings, utcTimezone} from 'date-vir';
let result = toDatePartStrings(
{
year: 2024,
month: 4,
day: 24,
hour: 6,
minute: 4,
second: 9,
millisecond: 123,
timezone: utcTimezone,
},
{includeSeconds: true},
);
// outputs:
result = {
date: '2024-04-24',
time: '06:04:09',
timezone: 'UTC',
};
Splits a FullDate up into multiple formatted string representations.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.
This uses numbers for everything.
A day of the month: 1-31 depending on the month
Hour of the day in 24 time: 0-23
Optional
millisecond?: null | numberMillisecond of the second: 0-999
Minute of the hour: 0-59
A month of the year: 1-12
The full, four digit year.
import {toDatePartStrings, utcTimezone} from 'date-vir';
let result = toDatePartStrings(
{
year: 2024,
month: 4,
day: 24,
hour: 6,
minute: 4,
second: 9,
millisecond: 123,
timezone: utcTimezone,
},
{includeSeconds: true},
);
// outputs:
result = {
date: '2024-04-24',
time: '06:04:09',
timezone: 'UTC',
};
Splits a FullDate up into multiple formatted string representations.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.
This uses numbers for everything.
Example