Get the current date and time.
Returns a new Date object representing the current moment. This function provides a consistent way to get the current time across the chronia library ecosystem.
Current date and time as Date object
import { now } from 'chronia';const currentTime = now();console.log(currentTime); // 2025-01-21T10:30:45.123Z// Use with other chronia functionsconst tomorrow = addDays(now(), 1);const oneHourAgo = subHours(now(), 1);const formatted = format(now(), 'yyyy-MM-dd HH:mm:ss'); Copy
import { now } from 'chronia';const currentTime = now();console.log(currentTime); // 2025-01-21T10:30:45.123Z// Use with other chronia functionsconst tomorrow = addDays(now(), 1);const oneHourAgo = subHours(now(), 1);const formatted = format(now(), 'yyyy-MM-dd HH:mm:ss');
Get the current date and time.
Returns a new Date object representing the current moment. This function provides a consistent way to get the current time across the chronia library ecosystem.