@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
17 lines (15 loc) • 406 B
JavaScript
import { nowInstant } from "../../internal/temporalCompat/clock.js";
// src/utc/get/getUtcNow.ts
/**
* Return the current UTC instant as an ISO Instant string.
*
* - Uses nowInstant() to get current UTC time.
*
* @returns ISO Instant string (e.g. "2024-02-29T00:00:00Z")
*
* @example getUtcNow() // "2024-02-29T00:00:00Z"
*/
function getUtcNow() {
return nowInstant().toString();
}
export { getUtcNow };