# Finance

Industry: Finance

Trading and payment messages carry timestamps in their own formats, not the ISO date-time format. A FIX timestamp states its precision by how many fraction digits it has, and may name a leap second. This layer reads and writes those values as standard instants, keeping what the digits say. A SWIFT value date has a two-digit year, and SWIFT states its century by rule, so it needs no window from you.

## What these functions solve

- **A trade stamp loses its precision.** [`parseFixUtcTimestamp`](/gmt/reference/finance/parse/parseFixUtcTimestamp/) reports the precision the digits state and keeps every digit sent, picoseconds included. See [tool](/gmt/tools/fix-timestamp-reader/), [guide](/gmt/guides/industries/finance-message-timestamps/), [scenario](/gmt/scenarios/a-millisecond-stamp-read-as-nanoseconds/).
- **A counterparty asks for a precision the clock does not match.** [`formatFixUtcTimestamp`](/gmt/reference/finance/format/formatFixUtcTimestamp/) writes the width asked for, cutting the fraction rather than rounding it, so a stamp never moves into the next second. See [tool](/gmt/tools/fix-timestamp-reader/), [guide](/gmt/guides/industries/finance-message-timestamps/), [mistakes](/gmt/mistakes/finance/).
- **A leap second is rejected, or accepted on the wrong day.** [`isValidFixUtcTimestamp`](/gmt/reference/finance/validate/isValidFixUtcTimestamp/) accepts a second of sixty only for a leap second UTC really inserted. See [tool](/gmt/tools/fix-timestamp-reader/), [guide](/gmt/guides/industries/finance-message-timestamps/), [scenario](/gmt/scenarios/second-sixty-on-an-ordinary-day/).
- **A two-digit value date lands in the wrong century.** [`parseSwiftDate`](/gmt/reference/finance/parse/parseSwiftDate/) applies SWIFT's own century rule, and refuses a year past the end of SWIFT's range, as SWIFT does. See [tool](/gmt/tools/swift-value-date-reader/), [guide](/gmt/guides/industries/finance-message-timestamps/), [scenario](/gmt/scenarios/a-value-date-in-the-wrong-century/).

Start with the guide: [Finance: Message Timestamps](/gmt/guides/industries/finance-message-timestamps/).

## Its own functions

### [`finance`](/gmt/reference/finance/)

**[format](/gmt/reference/finance/format/)**

- [`formatFixUtcTimestamp`](/gmt/reference/finance/format/formatFixUtcTimestamp/): Write an instant as a FIX `UTCTimestamp` at the precision a counterparty asks for.
- [`formatSwiftDate`](/gmt/reference/finance/format/formatSwiftDate/): Write an ISO 8601 date as a SWIFT MT value date, `YYMMDD`.

**[parse](/gmt/reference/finance/parse/)**

- [`parseFixUtcTimestamp`](/gmt/reference/finance/parse/parseFixUtcTimestamp/): Read a FIX `UTCTimestamp` as a UTC instant and the precision its digits state.
- [`parseSwiftDate`](/gmt/reference/finance/parse/parseSwiftDate/): Read the value date of a SWIFT MT message, `YYMMDD`, as an ISO 8601 date.

**[validate](/gmt/reference/finance/validate/)**

- [`isValidFixUtcTimestamp`](/gmt/reference/finance/validate/isValidFixUtcTimestamp/): Return true when `value` is a FIX `UTCTimestamp` that states a real UTC second.
- [`isValidSwiftDate`](/gmt/reference/finance/validate/isValidSwiftDate/): Return true when `value` is a SWIFT MT value date, `YYMMDD`, that SWIFT accepts.

## Guides

- [Finance: Message Timestamps](/gmt/guides/industries/finance-message-timestamps/): parseFixUtcTimestamp, formatFixUtcTimestamp and isValidFixUtcTimestamp read and write the FIX UTCTimestamp at the precision its digits state, with a second of sixty accepted only for a leap second UTC really inserted. parseSwiftDate, formatSwiftDate and isValidSwiftDate do the same for the SWIFT MT value date, using the century SWIFT states.

## Tools

- [FIX Timestamp Reader](/gmt/tools/fix-timestamp-reader/): Paste a FIX UTCTimestamp. The tool reads it with parseFixUtcTimestamp and isValidFixUtcTimestamp: the instant, the precision its digit count states, whether a second 60 is an inserted leap second, and the picosecond digits apart from the instant. A second section writes one instant at all five precisions.
- [SWIFT Value Date Reader](/gmt/tools/swift-value-date-reader/): Paste a SWIFT value date, YYMMDD. The tool reads it with parseSwiftDate and isValidSwiftDate, shows the century SWIFT gives the two-digit year and the T50 refusal, and writes an ISO date back with formatSwiftDate.

## Scenarios

- [A Millisecond Stamp Read as Nanoseconds](/gmt/scenarios/a-millisecond-stamp-read-as-nanoseconds/): A FIX stamp with three fraction digits goes through an ISO conversion and comes out with nine, and the extra six were never measured.
- [A Value Date in the Wrong Century](/gmt/scenarios/a-value-date-in-the-wrong-century/): A ten-year swap leg settles on a value date sent as 350615, and a home-made century cut-off stores 1935 instead of 2035.
- [Second Sixty on an Ordinary Day](/gmt/scenarios/second-sixty-on-an-ordinary-day/): A FIX stamp ends in :60 on a day with no leap second, the shape check passes, and Temporal stores it as a second that already happened.

## Mistakes

- [Finance](/gmt/mistakes/finance/): Common mistakes with FIX UTC timestamps, the precision their digits state, rounding when narrowing, the second of sixty, and SWIFT value dates and the century they state, in GMT's Finance layer.
