web-collect-events-narayana
Version:
An sdk for collecting events from web pages
16 lines (12 loc) • 496 B
text/typescript
export default function getDateTimeIndex(): Record<string, any> {
const dateTimeIndex: Record<string, any> = {};
const now = new Date();
// Retrieve date and time information
dateTimeIndex.year = now.getFullYear();
dateTimeIndex.month = now.getMonth() + 1; // Months are zero-based, so add 1
dateTimeIndex.day = now.getDate();
dateTimeIndex.hours = now.getHours();
dateTimeIndex.minutes = now.getMinutes();
dateTimeIndex.seconds = now.getSeconds();
return dateTimeIndex;
}