{"library":"oc-get-unix-utc-timestamp","title":"UTC Unix Timestamp Utility","description":"This package, `oc-get-unix-utc-timestamp` (v1.0.6), provides a straightforward utility function to retrieve the current Coordinated Universal Time (UTC) Unix timestamp. Published over four years ago, it maintains a stable, minimal footprint with zero external runtime dependencies. It ships with built-in TypeScript type definitions, enhancing development in typed environments. The primary function likely returns the timestamp in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC), aligning with JavaScript's native `Date.now()` behavior, which is a common source of confusion when \"Unix timestamp\" often refers to seconds. Its release cadence appears to be stable rather than actively developed, positioning it as a mature, low-maintenance utility. With weekly downloads around 19,000, it remains a used option for developers needing this specific functionality without additional overhead.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install oc-get-unix-utc-timestamp"],"cli":null},"imports":["import { getUnixUtcTimestamp } from 'oc-get-unix-utc-timestamp';","import type { GetUnixUtcTimestamp } from 'oc-get-unix-utc-timestamp';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { getUnixUtcTimestamp } from 'oc-get-unix-utc-timestamp';\n\n// Get the current UTC Unix timestamp in milliseconds\nconst timestampMs: number = getUnixUtcTimestamp();\nconsole.log(`Current UTC Unix timestamp (ms): ${timestampMs}`);\n\n// To get the timestamp in seconds, divide by 1000 and floor\nconst timestampSeconds: number = Math.floor(timestampMs / 1000);\nconsole.log(`Current UTC Unix timestamp (seconds): ${timestampSeconds}`);\n\n// Example: Convert to a Date object\nconst dateFromTimestamp = new Date(timestampMs);\nconsole.log(`Date object from timestamp: ${dateFromTimestamp.toUTCString()}`);","lang":"typescript","description":"Demonstrates how to import and use `getUnixUtcTimestamp` to retrieve the current UTC Unix timestamp in milliseconds and convert it to seconds or a Date object.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}