/** * Timestamp parsing utilities for ProtoPedia and W3C-DTF formats. * * @module utils/time/parse */ /** * Parse ProtoPedia timestamp (JST without explicit timezone offset). * * ProtoPedia timestamps are JST-based timestamps without explicit timezone offset. * Current format: `YYYY-MM-DD HH:MM:SS.0` (space separator, `.0` for zero milliseconds) * Example: `2025-11-14 12:03:07.0` * * ## Fractional Seconds Support * * Currently, ProtoPedia API outputs `.0` (single digit, no sub-second precision). * However, this parser accepts any number of fractional digits to accommodate * future API changes: * * - Current: `2025-10-08 18:03:48.0` (1 digit) * - Future possibilities: * - Milliseconds: `2025-10-08 18:03:48.123` (3 digits) * - Microseconds: `2025-10-08 18:03:48.123456` (6 digits) * - Nanoseconds: `2025-10-08 18:03:48.123456789` (9 digits) * * The regex pattern `\.(\d+)` accepts 1 or more digits to support all these cases, * as the underlying Java implementation may begin storing sub-second precision * in the database. * * @param value - String to parse * @returns UTC ISO string if valid ProtoPedia timestamp, undefined otherwise */ export declare function parseProtoPediaTimestamp(value: string): string | undefined; /** * Parse W3C Date and Time Formats (W3C-DTF) timestamps. * * Implements W3C-DTF Level 4-6, which are datetime formats with mandatory * timezone designator (TZD). This is a strict profile of ISO 8601 designed * for web standards. * * **Specification:** https://www.w3.org/TR/NOTE-datetime * * ## Supported Formats * * **Level 4: Complete date plus hours and minutes** * - Format: `YYYY-MM-DDThh:mmTZD` * - Examples: `2025-11-14T12:03Z`, `2025-11-14T12:03+09:00` * * **Level 5: Complete date plus hours, minutes and seconds** * - Format: `YYYY-MM-DDThh:mm:ssTZD` * - Examples: `2025-11-14T12:03:07Z`, `2025-11-14T12:03:07-05:00` * * **Level 6: Complete date plus hours, minutes, seconds and fractional seconds** * - Format: `YYYY-MM-DDThh:mm:ss.sTZD` * - Examples: `2025-11-14T12:03:07.123Z`, `2025-11-14T12:03:07.45+09:00` * - Fractional seconds: 1 or more digits (no maximum) * * ## Timezone Designator (TZD) * * - `Z` or `z`: UTC (Coordinated Universal Time) * - `+HH:MM` or `-HH:MM`: Offset from UTC (colon required per W3C-DTF) * * ## NOT Supported (returns undefined) * * - W3C-DTF Level 1-3 (year-only, year-month, date-only): `2025`, `2025-11`, `2025-11-14` * - Timestamps without TZD: `2025-11-14T12:03:07` (timezone-dependent) * - Offset without colon: `2025-11-14T12:03:07+0900` (not W3C-DTF compliant) * - Other ISO 8601 variants (week dates, ordinal dates, basic format) * * @param value - String to parse * @returns UTC ISO string if valid W3C-DTF Level 4-6, undefined otherwise * * @example * ```typescript * parseW3cDtfTimestamp('2025-11-14T12:03Z') * // => '2025-11-14T12:03:00.000Z' * * parseW3cDtfTimestamp('2025-11-14T12:03:07+09:00') * // => '2025-11-14T03:03:07.000Z' * * parseW3cDtfTimestamp('2025-11-14T12:03:07.123Z') * // => '2025-11-14T12:03:07.123Z' * * parseW3cDtfTimestamp('2025-11-14T12:03:07') * // => undefined (no TZD) * * parseW3cDtfTimestamp('2025-11-14') * // => undefined (date-only, Level 3) * ``` */ export declare function parseW3cDtfTimestamp(value: string): string | undefined; //# sourceMappingURL=parser.d.ts.map