npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

julian.js

v1.6.0

Published

JD for the UTC OR DT

Downloads

22

Readme

julian.js

Julian Day Object,extend Date Object 基于Date并支持儒略日的时间函数对象,主要用于天文或大时间尺度的计算

USAGE/使用

const Time = require("julian.js");
const date = new Time();
const jd = date.getJD();

API

INIT/初始化

new Time(date,ignore)

date

Date Object Date对象

ignore

ignore ΔT, default true 是否忽略力学时和世界协调时的差距(ΔT)

JulianDay/儒略日

object.getJulianDay()

get julian day 获取儒略日

object.getJD()

same with getJulianDay() 获取儒略日 同getJulianDay()

object.getModifiedJulianDay()

获取简化儒略日,即儒略日 - 2400000.5

object.getMJD()

获取简化儒略日 同getModifiedJulianDay()

力学时 DynamicTime

object.getDynamicTime()

获取力学时对应的date

object.getDT()

获取力学时对应的date 同getDynamicTime()

object.getDynamicDate()

获取力学时的天数

object.getDynamicDay()

获取力学时的星期

object.getDynamicFullYear()

获取力学时的年

object.getDynamicHours()

获取力学时的小时

object.getDynamicMilliseconds()

获取力学时的毫秒

object.getDynamicMinutes()

获取力学时的分钟

object.getDynamicMonth()

获取力学时的月份

object.getDynamicSeconds()

获取力学时的秒数

STATIC METHOD/静态方法

time.UTC$TD

utc转TD

time.TD$UTC

TD转utc

time.UTC$JD

UTC转JD

time.JD$UTC

JD转UTC

time.TD$JD

TD转JD

TIME.TD$JD(y,M,d,h,m,s);

time.$TD$JD

TD转JD

TIME.TD$JD(date);

time.JD$TD

JD转TD

return {y,M,d,h,m,s}

time.$JD$TD

JD转TD return date

time.isGregorianDays

判断是否是格里历

TIME.isGregorianDays(year,month,date);

time.setDeltaTAlgorithm

设置 DeltaT 算法 默认为NASA提供(src/algorithm/nasa.js) DeltaT = UTC - TD

注意事项

  • 该模块中的力学时为地球力学时和质心力学时的统称,不考虑两者之间的差值问题
  • 该模块不考虑世界时和世界协调时的差值