solar-time
Version:
This library provides functions to calculate local solar time, also known as local apparent time, based on a given location and date.
34 lines (33 loc) • 1.09 kB
TypeScript
import dayjs from "dayjs";
/**
* Calculate solar time for a specific date
* @param {Date} date - The date to calculate the solar time.
* @param {number} longitude - The longitude of the location.
* @param {Object} [options] - The options to calculate the solar time.
* @param {number} [options.utc] - The UTC offset to use, defaults to the local UTC offset.
* @returns {LST: Dayjs, TC: number, EoT: number, B: number, LSTM: number}
*/
export declare const Solar: (date: Date, longitude: number, options?: {
utc: number;
}) => {
LST: dayjs.Dayjs;
TC: number;
EoT: number;
B: number;
LSTM: number;
};
/**
* Calculate solar time for the current date
* @param {number} longitude - The longitude of the location.
* @param {Object} [options] - The options to calculate the solar time.
* @param {number} [options.utc] - The UTC offset to use, defaults to the local UTC offset.
*/
export declare const SolarNow: (longitude: number, options?: {
utc: number;
}) => {
LST: dayjs.Dayjs;
TC: number;
EoT: number;
B: number;
LSTM: number;
};