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.
10 lines (9 loc) • 474 B
TypeScript
import type { SolarTimeResult } from "./types";
/**
* Calculate local solar time using Spencer's Equation (±30s accuracy).
*
* @param isoDateTime - ISO 8601 string with timezone (e.g., "2025-11-01T09:00:00+09:00")
* @param longitude - Longitude in degrees (-180 to 180, + = East, - = West)
* @returns Solar time results with LST as ISO 8601 string preserving timezone
*/
export declare const getSolarTime: (isoDateTime: string, longitude: number) => SolarTimeResult;