/** * Formats a Date object to ServiceNow UTC datetime format (YYYY-MM-DD HH:MM:SS) * @param date - The Date object to format (defaults to current time) * @returns Formatted UTC datetime string * * @example * const formatted = formatToUTC(new Date()); * // Returns: '1970-01-01 09:45:00' * * @example * const formatted = formatToUTC(); * // Returns current time in UTC: '2026-02-27 07:43:00' */ export declare function formatToUTC(date?: Date): string; /** * Converts a datetime string from a specified timezone to UTC. * Similar to timeFieldToXML but handles full date and time, not just time of day. * * @param dateTimeStr - DateTime string in format 'YYYY-MM-DD HH:MM:SS' * @param timeZone - Optional IANA timezone string (e.g., 'America/New_York', 'Asia/Kolkata'). Defaults to system timezone. * @returns Formatted UTC datetime string in 'YYYY-MM-DD HH:MM:SS' format * * @example * // Convert '2026-03-02 14:30:00' from IST to UTC * const utcDate = dateTimeFieldToXML('2026-03-02 14:30:00', 'Asia/Kolkata') * // Returns '2026-03-02 09:00:00' */ export declare function dateTimeFieldToXML(dateTimeStr: string, timeZone?: string): string; /** * Converts an XML datetime string (in UTC) to a datetime string in a specified timezone * @param utcDateTimeStr - UTC datetime string in format 'YYYY-MM-DD HH:MM:SS' * @param timeZone - Optional IANA timezone string (e.g., 'America/New_York', 'Asia/Kolkata'). If not provided, returns the UTC string as-is. * @returns Datetime string in the specified timezone in 'YYYY-MM-DD HH:MM:SS' format * * @example * // Convert '2026-03-02 09:00:00' UTC to IST * const localDateTime = convertXMLToDateTime('2026-03-02 09:00:00', 'Asia/Kolkata') * // Returns '2026-03-02 14:30:00' * * @example * // Without timezone, returns the UTC string as-is * const utcDateTime = convertXMLToDateTime('2026-03-02 09:00:00') * // Returns '2026-03-02 09:00:00' */ export declare function convertXMLToDateTime(utcDateTimeStr: string, timeZone?: string): string; /** * Formats time data (hours, minutes, seconds) as a datetime string without timezone conversion. * Used for storing the original user-entered time value in the 'entered_time' field. * * @param timeData - Object containing hours, minutes, and seconds * @returns Formatted datetime string in 'YYYY-MM-DD HH:MM:SS' format with epoch date (1970-01-01) * * @example * formatTimeDataToDateTime({ hours: 14, minutes: 30, seconds: 0 }) * // Returns '1970-01-01 14:30:00' */ export declare function formatTimeDataToDateTime(timeData: { hours?: number; minutes?: number; seconds?: number; }): string;