# @cityssm/modern-julian-date

> Converts a regular JavaScript date to the modern Julian date format YYYYDDD.

Latest version **1.0.3** (published 2026-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cityssm/modern-julian-date
pnpm add @cityssm/modern-julian-date
yarn add @cityssm/modern-julian-date
bun add @cityssm/modern-julian-date
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-08-19 |
| First published | 2022-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.0.0 |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | The Corporation of the City of Sault Ste. Marie |
| Maintainers | dgowans |
| Keywords | julian, date, format, banking, modern-julian, yyyyddd, yyddd |

## Links

- npm: https://www.npmjs.com/package/@cityssm/modern-julian-date
- Repository: https://github.com/cityssm/modern-julian-date
- Homepage: https://github.com/cityssm/modern-julian-date#readme
- Issues: https://github.com/cityssm/modern-julian-date/issues
- npm.io page: https://npm.io/package/@cityssm/modern-julian-date

## Dependencies (1)

- [@cityssm/to-millis](https://npm.io/package/@cityssm/to-millis.md) ^1.0.1

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2026-08-19
- 1.0.2 — 2025-07-11
- 1.0.1 — 2024-08-01
- 1.0.0 — 2023-12-11
- 0.1.0 — 2022-04-11

## README

# Modern Julian Date

[![npm (scoped)](https://img.shields.io/npm/v/@cityssm/modern-julian-date)](https://www.npmjs.com/package/@cityssm/modern-julian-date)
[![DeepSource](https://app.deepsource.com/gh/cityssm/modern-julian-date.svg/?label=active+issues&show_trend=true&token=gVQq0XqtU1PZ2BWi_k-y1so9)](https://app.deepsource.com/gh/cityssm/modern-julian-date/)
[![codecov](https://codecov.io/gh/cityssm/modern-julian-date/graph/badge.svg?token=O2640MNNY0)](https://codecov.io/gh/cityssm/modern-julian-date)

Converts a regular JavaScript date to the modern Julian date format YYYYDDD,
commonly seen in banking applications.

## Getting Started

```sh
npm install @cityssm/modern-julian-date
```

## Usage

```javascript
import {
  fromModernJulianDate,
  toModernJulianDate,
  toShortModernJulianDate
} from "@cityssm/modern-julian-date";

/*
 * toModernJulianDate()
 * Returns date strings in YYYYDDD format.
 */

console.log( toModernJulianDate(new Date(2022, 1 - 1, 1)) );
// => '2022001'

console.log( toModernJulianDate(new Date(2022, 12 - 1, 31)) );
// => '2022365'

console.log( toModernJulianDate(new Date(2020, 12 - 1, 31)) );
// => '2020366'

/*
 * toShortModernJulianDate()
 * Returns date strings in YYDDD format.
 */

console.log( toShortModernJulianDate(new Date(2022, 1 - 1, 1)) );
// => '22001'

/*
 * fromModernJulianDate()
 * Returns Date objects.
 */

console.log( fromModernJulianDate('2020366') )
// => 'Thu Dec 31 2020 00:00:00 GMT-0500 (Eastern Standard Time)'
```

---
_Source: https://npm.io/package/@cityssm/modern-julian-date · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
