MCPcopy Create free account
hub / github.com/node-modules/utility / YYYYMMDD

Function YYYYMMDD

src/date.ts:133–147  ·  view source on GitHub ↗
(d?: Date | string, sep?: string)

Source from the content-addressed store, hash-verified

131 * `moment().format('YYYY-MM-DD')` format date string.
132 */
133export function YYYYMMDD(d?: Date | string, sep?: string): string {
134 if (typeof d === 'string') {
135 // YYYYMMDD(sep)
136 sep = d;
137 d = new Date();
138 } else {
139 // YYYYMMDD(d, sep)
140 d = d || new Date();
141 if (typeof sep !== 'string') {
142 sep = '-';
143 }
144 }
145 const [ year, month, date ] = getDateStringParts(d, true);
146 return `${year}${sep}${month}${sep}${date}`;
147}
148
149export interface DateStruct {
150 YYYYMMDD: number;

Callers 1

getDateFromMillisecondsFunction · 0.85

Calls 1

getDateStringPartsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…