Skip to content

Code B Day Ruler

  • The core functions, which every industry uses.

CCSDS Code B writes a UTC date as a year and a day number, such as 2024-061. Pick two years and a day: the tool reads the day in each with parseCcsdsAsciiB, writes it back with formatCcsdsAsciiA, and finds where each month starts with formatCcsdsAsciiB. To read a whole code, use the CCSDS Time Code Decoder.

1. Two years and a day

Day 061 is 1 March in 2024 and 2 March in 2026.

A year from 1 to 9999.

A second year to read the same day in.

2. The same day in each year

2024
Code B
 
Code A
 
Date
 
2026
Code B
 
Code A
 
Date
 

Give two years to compare.

3. The calls

Day of year, not month. Day 061 is 1 March in 2024 and 2 March in 2026, because 2024 has a 29 February and 2026 does not. Every date after February moves by one day between a leap year and a common year, so a Code B text names no fixed month and day. Days 1 to 59 do not move: 2024-059 and 2026-059 are both 28 February. The ruler puts both years on one scale of 366 day columns, so each month after February starts a column further left in a leap year.

Day 366. Only a leap year has one. 2016-366 is 31 December 2016, and the library refuses 2017-366. The ruler draws that last column hatched and labelled no day 366 in a year that lacks it.

Leap years come from the library. The tool holds no leap-year rule and no table of month lengths. It asks parseCcsdsAsciiB whether a year has a day 366, and formatCcsdsAsciiB for the day each month starts on. So 2000 has a 29 February and 2100 does not: day 060 is 29 February in 2000 and 1 March in 2100. A year the library cannot read, such as 10000, shows no result beside a lane that still works.

import { parseCcsdsAsciiB } from "@northguild/gmt/timescale/parse";
import { formatCcsdsAsciiA } from "@northguild/gmt/timescale/format";
formatCcsdsAsciiA(parseCcsdsAsciiB("2024-061T00:00:00Z"), 0); // "2024-03-01T00:00:00Z"
formatCcsdsAsciiA(parseCcsdsAsciiB("2026-061T00:00:00Z"), 0); // "2026-03-02T00:00:00Z"
parseCcsdsAsciiB("2017-366T00:00:00Z"); // ""

Worth trying: day 061 in 2024 against 2026, then drag the slider to day 366 with 2016 against 2017. The rules are in Leap seconds and TAI.

© 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.