1.0.3 • Published 5 months ago

local-iso-timestamp v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

local-iso-timestamp

A simple utility to get the current local date and time in ISO 8601 format with timezone offset.

Installation

npm install local-iso-timestamp

Usage

JavaScript

const { getLocalIsoTimestamp } = require('local-iso-timestamp');
console.log(getLocalIsoTimestamp());
// Output: 2024-10-12T22:15:16.521+13:00 (ISO 8601 format, depending on your local timezone)

const date = new Date('2023-10-12T22:15:16.521Z');
console.log(getLocalIsoTimestamp(date));
// Output: 2023-10-12T22:15:16.521+13:00 (ISO 8601 format, depending on your local timezone)

TypeScript

import { getLocalIsoTimestamp } from 'local-iso-timestamp';
console.log(getLocalIsoTimestamp());
// Output: 2024-10-12T22:15:16.521+13:00 (ISO 8601 format, depending on your local timezone)

const date = new Date('2023-10-12T22:15:16.521Z');
console.log(getLocalIsoTimestamp(date));
// Output: 2023-10-12T22:15:16.521+13:00 (ISO 8601 format, depending on your local timezone)

Source

GitHub

License

MIT License

1.0.3

5 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago