parseSwiftDate
Signature
Section titled “Signature”parseSwiftDate(value: string): stringRead the value date of a SWIFT MT message, YYMMDD, as an ISO 8601 date.
- What it reads. The six-digit date component (
<DATE2>,6!n) of field 30 or field 32A, such as240615from:32A:240615EUR1000,00. Pass the date component alone: a field tag, a currency, an amount or whitespace returns"". Digits are ASCII0–9. - The century is SWIFT’s. SWIFT fixes it for value dates: a
YYfrom01to60is 20YY, so the date runs from 2001 to 2060, and any otherYYis refused (error T50). So00and61–99return"". The function takes no window: there is no choice to make. - Where the rule applies. SWIFT states it for value dates: field 32A of MT 910, and fields 30 and 32A of category 1 and 2 messages other than the common group messages n92, n95 and n96. SWIFT states no century for other six-digit dates, such as field 31D of MT 700; read those with
parseDateWithPatternand theyearWindowyou know. - Days must exist in the year the rule gives:
040229is 29 February 2004, and050229returns"". - Sources. SWIFT Standards MT, MT 103 field 32A (format
6!n3!a15d; “Date must be a valid date expressed as YYMMDD”, T50), in SWIFT’s Knowledge Centre, which needs a login. SWIFT Standards MT General Information (Standards MT November 2025), §6.3.1 Dates and §6.3.6 Value Date Ordering, which needs none: https://www2.swift.com/knowledgecentre/rest/v1/publications/usgi_20250718/2.0/usgi_20250718.pdf - Returns
""for a non-string argument.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | A SWIFT value date, YYMMDD (e.g. “240615”) |
Returns
Section titled “Returns”the ISO date (“2024-06-15”), or "" on invalid input
Examples
Section titled “Examples”import { parseSwiftDate } from "@northguild/gmt/finance/parse";
parseSwiftDate("240615") // "2024-06-15"Source
Section titled “Source”© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.