Socket
Socket
Sign inDemoInstall

gdate-julian

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gdate-julian

Converts date to and from julian days in gLib GDate style


Version published
Weekly downloads
9
decreased by-10%
Maintainers
1
Install size
32.2 kB
Created
Weekly downloads
 

Changelog

Source

2.0.1 (2023-04-20)

Bug Fixes

  • update readme (d340e80)

Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning, enforced with semantic-release.

Readme

Source

hpore# GDate (GLib) style julian days to and from gregorian date converter Port of GLib functions to work with julian days, to convert between it and gregorian date. Library was initially developed to help a sister library node-xhb work with file generated by HomeBank

Install

npm install gdate-julian

Usage

Import ESM style

import {dateToJulianDays, julianDaysToDate} from 'gdate-julian' 

Example

Here we show small example how to convert between Gregorian Date and Julian Days More detailed examples can be found in tests in ./src/__tests__/date_conversion_spec.js

Gregorian Date to Julian Days

const julianDays = dateToJulianDays(new Date('1900-01-01T12:00:00Z'))
console.log(julianDays) // outputs 693596

Julian Days to Gregorian Date

const gregorianDate = julianDaysToDate(693596)
console.log(gregorianDate) // outputs 1900-01-01T12:00:00Z

TypeScript definitions

Project also includes type definitions for TypeScript in ./src/index.d.ts

License

The code provided here is based off GLib codebase, hence licenced under same LGPL.

Keywords

FAQs

Last updated on 20 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc