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

Function accessLogDate

src/date.ts:58–64  ·  view source on GitHub ↗
(d?: Date)

Source from the content-addressed store, hash-verified

56 * Access log format date. format: `moment().format('DD/MMM/YYYY:HH:mm:ss ZZ')`
57 */
58export function accessLogDate(d?: Date): string {
59 // 16/Apr/2013:16:40:09 +0800
60 d = d || new Date();
61 const [ year, month, date, hours, minutes, seconds ] = getDateStringParts(d);
62 const TIMEZONE = getTimezone(d);
63 return `${date}/${MONTHS[month]}/${year}:${hours}:${minutes}:${seconds} ${TIMEZONE}`;
64}
65
66export function getTimezone(d: Date) {
67 const key = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();

Callers 1

getDateFromMillisecondsFunction · 0.85

Calls 2

getDateStringPartsFunction · 0.85
getTimezoneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…