MCPcopy Create free account
hub / github.com/bitpay/bitcore / formatDate

Method formatDate

packages/bitcore-cli/src/utils.ts:388–404  ·  view source on GitHub ↗
(date: Date | number | string)

Source from the content-addressed store, hash-verified

386 }
387
388 static formatDate(date: Date | number | string) {
389 if (!(date instanceof Date)) {
390 date = new Date(date);
391 }
392 const formatter = Intl.DateTimeFormat('en-US', {
393 weekday: 'short',
394 year: 'numeric',
395 month: 'short',
396 day: '2-digit',
397 hour: '2-digit',
398 hour12: false,
399 minute: '2-digit',
400 second: '2-digit',
401 timeZoneName: 'short',
402 });
403 return formatter.format(date).replace(/,/g, '');
404 }
405
406 static formatDateCompact(date: Date | number | string) {
407 if (!(date instanceof Date)) {

Callers 5

transformFunction · 0.45
utils.test.tsFile · 0.45
walletStatusFunction · 0.45
getTxHistoryFunction · 0.45
getTxProposalsFunction · 0.45

Calls

no outgoing calls

Tested by 1

transformFunction · 0.36