gmt-basics

Parse, format, compare, and validate ISO 8601 date strings using Temporal-based functions.

6|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/northguild/gmt --skill gmt-basics-northguild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gmt-basics
Source: https://github.com/northguild/gmt/tree/main/packages/gmt/skills/gmt-basics
Command: npx skills add https://github.com/northguild/gmt --skill gmt-basics-northguild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @northguild/gmt.

What problem does it solve? JavaScript date handling with the legacy Date object is error-prone across timezones, locales, and calendar boundaries. This Skill routes you to the correct @northguild/gmt functions for everyday date/time read operations — getting current values, parsing components, formatting for display, comparing values, and validating inputs — without ever touching new Date(). ## Core Features & Use Cases - Current values and parsing: Get now/today as ISO strings, extract year/month/day components, and parse RFC 3339, HTTP, and SQL date formats with sentinel returns instead of thrown errors. - Formatting and locale names: Format dates, times, and relative strings like "yesterday", plus retrieve localized month, weekday, meridiem, and era names. - Calendar identifiers and comparison: Read ISO week, ordinal, quarter, and fiscal 4-5-4 periods, then compare, sort, or check weekend/business-day status. - Use Case: A user needs the ISO week number for a vessel schedule date and a localized display string for a UI. The Skill points to getIsoWeekDate (which returns the week-numbering year alongside the week) and formatDate, with validation via isValidDate first. ## Quick Start Ask the assistant to get the current date, extract the ISO week from a given date string, and format it for display using the gmt-basics skill.

Frequently Asked Questions about gmt-basics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get the current date as an ISO string in JavaScript without new Date()?▼

Use getNow, getToday, getUtcNow, or getUnixNow from @northguild/gmt, which return ISO 8601 strings or Unix epochs built on the Temporal standard. These functions never construct a Date object and return sentinel values on failure.

How do I get the ISO week number from a date string?▼

Use getIsoWeekDate, which returns the week number together with the week-numbering year so the pair cannot drift apart across year boundaries. Use getWeekYear to read that year on its own.

Why does formatRelativeDate return an empty string?▼

formatRelativeDate requires a reference option to compare against; without it the function returns the sentinel empty string. GMT functions never throw — they return "", null, false, or [] — so always check results before using them.

Does GMT date parsing reject invalid dates like February 31?▼

Yes. Parsers such as parseDateWithPattern, parseRfc2822, and parseHttp return an empty string for shape-valid-but-unreal dates because Temporal validates the real calendar value after the regex checks the shape. Only arithmetic operations clamp; parsers reject.

Can I check business days with locale-specific weekends and holidays?▼

isWeekend is locale-aware via Intl.Locale.weekInfo, while isBusinessDay defaults to fixed ISO Monday–Friday. Pass a BusinessCalendar object with weekend, holidays, and timeZone options to isBusinessDay to define custom rules.