vremel
Version:
JavaScript date utility library for Temporal API
13 lines (11 loc) • 373 B
text/typescript
import type { Temporal } from "../types.js";
import { modifiedJulianDate } from "./modifiedJulianDate.js";
/**
* Returns the julian date of the exact time which the given temporal object represents.
*
* @param instant instant
* @returns julian date
*/
export function julianDate(instant: Temporal.Instant): number {
return modifiedJulianDate(instant) + 2400000.5;
}