Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doniseferi/suntimes
A tiny library to get the exact date and time in an ISO 8601 format for certain points of the day for any desired location and date.
https://github.com/doniseferi/suntimes
astronomy declination-of-the-sun equation-of-time noon solar sunrise sunset suntimes twilight utc
Last synced: about 2 months ago
JSON representation
A tiny library to get the exact date and time in an ISO 8601 format for certain points of the day for any desired location and date.
- Host: GitHub
- URL: https://github.com/doniseferi/suntimes
- Owner: doniseferi
- License: isc
- Created: 2019-07-23T20:10:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:46:18.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T17:29:27.785Z (4 months ago)
- Topics: astronomy, declination-of-the-sun, equation-of-time, noon, solar, sunrise, sunset, suntimes, twilight, utc
- Language: JavaScript
- Homepage:
- Size: 2.36 MB
- Stars: 13
- Watchers: 0
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License.md
Awesome Lists containing this project
README
# [![Build Status](https://travis-ci.com/doniseferi/suntimes.svg?branch=master)](https://travis-ci.com/doniseferi/suntimes) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/27de579f6fc84188ba0aac2601ec05f0)](https://www.codacy.com/manual/doniseferi/suntimes?utm_source=github.com&utm_medium=referral&utm_content=doniseferi/suntimes&utm_campaign=Badge_Grade) ![GitHub](https://img.shields.io/github/license/doniseferi/suntimes) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/doniseferi/suntimes) ![Snyk Vulnerabilities for npm package version](https://img.shields.io/snyk/vulnerabilities/npm/suntimes) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/doniseferi/suntimes) ![GitHub last commit](https://img.shields.io/github/last-commit/doniseferi/suntimes) ![Coveralls github](https://img.shields.io/coveralls/github/doniseferi/suntimes) [![GitHub issues](https://img.shields.io/github/issues/doniseferi/suntimes)](https://github.com/doniseferi/suntimes/issues)
A tiny library to get the exact date and time in an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format for certain points of the day for any desired location and date.
## Install
```npm install suntimes```
## Api Reference
* * *
## Functions
-
getDeclinationOfTheSun(date) ⇒number
-
The angular distance of the sun north or south of the earth's equator.
-
equationOfTime(date) ⇒number
-
The correction between standard clock time and the time based on the exact position of the sun in the sky represented as decimal
time in minutes. -
getHourAngleSinceNoon(date, latitude, angle) ⇒number
-
Gets the hour angle difference between noon and the angle value.
-
getNoonHourAngle(date, longitude) ⇒number
-
Gets the noon hour angle for the date and longitude value.
-
getNoonDateTimeUtc(date, longitude) ⇒string
-
Gets the noon date and time in UTC expressed in an ISO 8601 format for date and longitude value.
-
getDateTimeUtcOfAngleBeforeNoon(angle, date, latitude, longitude) ⇒string
-
Gets the date and time in UTC expressed in an ISO 8601 format for an angle before noon for the angle, date, latitude and longitude value.
-
getDateTimeUtcOfAngleAfterNoon(angle, date, latitude, longitude) ⇒string
-
Gets the date and time in UTC expressed in an ISO 8601 format for an angle after noon for the angle, date, latitude and longitude value.
-
getSunriseDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the sunrise date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getSunsetDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the sunset date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getCivilDawnEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of civil dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getCivilDawnStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of civil dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getNauticalDawnEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of nautical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getNauticalDawnStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of nautical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getAstronomicalDawnEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of astronomical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude
value. -
getAstronomicalDawnStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of astronomical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getAstronomicalDuskStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of astronomical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getAstronomicalDuskEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of astronomical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude
value. -
getNauticalDuskEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of nautical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getNauticalDuskStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of nautical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getCivilDuskEndDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the end of civil dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
-
getCivilDuskStartDateTimeUtc(date, latitude, longitude) ⇒string
-
Gets the start of civil dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
## getDeclinationOfTheSun(date) ⇒ number
The angular distance of the sun north or south of the earth's equator.
**Kind**: global function
**Returns**: number
- The declination in degrees where north is a positive value and south is a negative value within a range of range of -23.45 and 23.45.
| Param | Type | Description |
| ----- | ----------------- | --------------- |
| date | Date
| A date instance |
**Example** *(Example usage of getDeclinationOfTheSun)*
```js
// returns -23.078780854838076
getDeclinationOfTheSun(new Date(2019, 0, 1));
```
* * *
## equationOfTime(date) ⇒ number
The correction between standard clock time and the time based on the exact position of the sun in the sky represented as decimal time in minutes.
**Kind**: global function
**Returns**: number
- A number whose value is the equation of time in minutes decimal time for the Date represented by date.
| Param | Type | Description |
| ----- | ----------------- | ---------------- |
| date | Date
| A date instance. |
**Example** *(Example usage of equationOfTime)*
```js
// returns -10.306964615344999
equationOfTime(new Date(2025, 0, 18));
```
* * *
## getHourAngleSinceNoon(date, latitude, angle) ⇒ number
Gets the hour angle difference between noon and the angle value.
**Kind**: global function
**Returns**: number
- A number whose value represents the hour angle since noon for the date, latitude and angle value.
**Throws**:
- RangeError
The sun altitude never elevates above the angle specified.
- RangeError
The sun altitude never drops below the angle specified.
| Param | Type | Description |
| -------- | ------------------- | ------------------------------------------- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| angle | number
| An angle value. |
**Example** *(Example usage of getHourAngleSinceNoon)*
```js
// returns 5.54554469317797
getHourAngleSinceNoon(new Date(2025, 0, 18), 51.477730, -12);
```
* * *
## getNoonHourAngle(date, longitude) ⇒ number
Gets the noon hour angle for the date and longitude value.
**Kind**: global function
**Returns**: number
- The noon hour angle expressed as a number between 0.00 and 23.9.
| Param | Type | Description |
| --------- | ------------------- | ---------------------------------------------- |
| date | Date
| A date instance. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNoonHourAngle)*
```js
// returns 12.17245941025575
getNoonHourAngle(new Date(2025, 0, 18), -0.010150);
```
* * *
## getNoonDateTimeUtc(date, longitude) ⇒ string
Gets the noon date and time in UTC expressed in an ISO 8601 format for date and longitude value.
**Kind**: global function
**Returns**: string
- A string representing noon date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --------- | ------------------- | ---------------------------------------------- |
| date | Date
| A date instance. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNoonDateTimeUtc)*
```js
// returns "2025-01-18T12:10:20.853Z"
getNoonDateTimeUtc(new Date(2025, 0, 18), -0.010150);
```
* * *
## getDateTimeUtcOfAngleBeforeNoon(angle, date, latitude, longitude) ⇒ string
Gets the date and time in UTC expressed in an ISO 8601 format for an angle before noon for the angle, date, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the time and date for an angle before noon in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --------- | ------------------- | ---------------------------------------------- |
| angle | number
| An angle value. |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getDateTimeUtcOfAngleBeforeNoon)*
```js
// returns "2025-01-18T05:57:45.720Z"
getDateTimeUtcOfAngleBeforeNoon(-18, new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getDateTimeUtcOfAngleBeforeNoon)*
```js
// returns "The sun's altitude does not drop to -18° on Wed Jun 18 2025 at latitude 51.47773 and longitude -0.01015"
getDateTimeUtcOfAngleBeforeNoon(-18, new Date(2025, 5, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getDateTimeUtcOfAngleBeforeNoon)*
```js
// returns "The sun's altitude does not rise to 18° on Wed Jun 18 2025 at latitude -51.47773 and longitude -0.01015"
getDateTimeUtcOfAngleBeforeNoon(18, new Date(2025, 5, 18), -51.477730, -0.010150);
```
* * *
## getDateTimeUtcOfAngleAfterNoon(angle, date, latitude, longitude) ⇒ string
Gets the date and time in UTC expressed in an ISO 8601 format for an angle after noon for the angle, date, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the time and date for an angle after noon in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --------- | ------------------- | ---------------------------------------------- |
| angle | number
| An angle value. |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getDateTimeUtcOfAngleAfterNoon)*
```js
//returns "2025-06-18T14:33:42.689Z"
getDateTimeUtcOfAngleAfterNoon(8, new Date(2025, 5, 18), -51.477730, -0.010150);
```
**Example** *(Example usage of getDateTimeUtcOfAngleAfterNoon)*
```js
// returns "The sun's altitude does not drop to -18° on Sat Jan 18 2025 at latitude -51.47773 and longitude -0.01015"
getDateTimeUtcOfAngleAfterNoon(-18, new Date(2025, 0, 18), -51.477730, -0.010150);
```
**Example** *(Example usage of getDateTimeUtcOfAngleAfterNoon)*
```js
// returns "The sun's altitude does not rise to 18° on Wed Jun 18 2025 at latitude -51.47773 and longitude -0.01015"
getDateTimeUtcOfAngleAfterNoon(18, new Date(2025, 5, 18), -51.477730, -0.010150);
```
* * *
## getSunriseDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the sunrise date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing sunrise date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --------- | ------------------- | ---------------------------------------------- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getSunriseDateTimeUtc)*
```js
// returns "2025-01-18T07:57:29.802Z"
getSunriseDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getSunriseDateTimeUtc)*
```js
// returns "The sun is up all day on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getSunriseDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
**Example** *(Example usage of getSunriseDateTimeUtc)*
```js
// returns "The sun is down all day on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getSunriseDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
* * *
## getSunsetDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the sunset date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing sunset date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getSunsetDateTimeUtc)*
```js
// returns "2025-01-18T16:23:11.903Z"
getSunsetDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getSunsetDateTimeUtc)*
```js
// returns "The sun is up all day on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getSunsetDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
**Example** *(Example usage of getSunsetDateTimeUtc)*
```js
// returns "The sun is down all day on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getSunsetDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
* * *
## getCivilDawnEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of civil dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of civil dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getCivilDawnEndDateTimeUtc)*
```js
// returns "2025-01-18T07:57:29.802Z"
getCivilDawnEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getCivilDawnEndDateTimeUtc)*
```js
// returns "The sun is up all day on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getCivilDawnEndDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
**Example** *(Example usage of getCivilDawnEndDateTimeUtc)*
```js
// returns "The sun is down all day on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45
getCivilDawnEndDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
* * *
## getCivilDawnStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of civil dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of civil dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getCivilDawnStartDateTimeUtc)*
```js
// returns "2025-01-18T07:19:15.781Z"
getCivilDawnStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getCivilDawnStartDateTimeUtc)*
```js
// returns "The sun's altitude does not rise to -6° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getCivilDawnStartDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
**Example** *(Example usage of getCivilDawnStartDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -6° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getCivilDawnStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getNauticalDawnEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of nautical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of nautical dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNauticalDawnEndDateTimeUtc)*
```js
// returns "2025-01-18T07:19:15.781Z"
getNauticalDawnEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getNauticalDawnEndDateTimeUtc)*
```js
// returns "The sun's altitude does not rise to -6° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getNauticalDawnEndDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
**Example** *(Example usage of getNauticalDawnEndDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -6° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getNauticalDawnEndDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getNauticalDawnStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of nautical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of nautical dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNauticalDawnStartDateTimeUtc)*
```js
// returns "2025-01-18T06:37:36.892Z"
getNauticalDawnStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getNauticalDawnStartDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -12° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getNauticalDawnStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
**Example** *(Example usage of getNauticalDawnStartDateTimeUtc)*
```js
// returns "The sun's altitude does not rise to -12° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getNauticalDawnStartDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
* * *
## getAstronomicalDawnEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of astronomical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of astronomical dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getAstronomicalDawnEndDateTimeUtc)*
```js
// returns "2025-01-18T06:37:36.892Z"
getAstronomicalDawnEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getAstronomicalDawnEndDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -12° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getAstronomicalDawnEndDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getAstronomicalDawnStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of astronomical dawn date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of astronomical dawn date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getAstronomicalDawnStartDateTimeUtc)*
```js
// returns "2025-01-18T05:57:45.720Z"
getAstronomicalDawnStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getAstronomicalDawnStartDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -18° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getAstronomicalDawnStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getAstronomicalDuskStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of astronomical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of astronomical dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getAstronomicalDuskStartDateTimeUtc)*
```js
// returns "2025-01-18T17:43:04.813Z"
getAstronomicalDuskStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getAstronomicalDuskStartDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -12° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getAstronomicalDuskStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getAstronomicalDuskEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of astronomical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of astronomical dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getAstronomicalDuskEndDateTimeUtc)*
```js
// returns "2025-01-18T18:22:55.985Z"
getAstronomicalDuskEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getAstronomicalDuskEndDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -18° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getAstronomicalDuskEndDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getNauticalDuskEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of nautical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of nautical dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNauticalDuskEndDateTimeUtc)*
```js
// returns "2025-01-18T17:43:04.813Z"
getNauticalDuskEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getNauticalDuskEndDateTimeUtc)*
```js
// returns The sun's altitude does not rise to -12° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45
getNauticalDuskEndDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
**Example** *(Example usage of getNauticalDuskEndDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -12° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getNauticalDuskEndDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getNauticalDuskStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of nautical dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of nautical dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getNauticalDuskStartDateTimeUtc)*
```js
// returns "2025-01-18T17:01:25.924Z"
getNauticalDuskStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getNauticalDuskStartDateTimeUtc)*
```js
// returns The sun's altitude does not rise to -6° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45
getNauticalDuskStartDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
**Example** *(Example usage of getNauticalDuskStartDateTimeUtc)*
```js
// returns "The sun's altitude does not drop to -6° on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getNauticalDuskStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
* * *
## getCivilDuskEndDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the end of civil dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the end of civil dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getCivilDuskEndDateTimeUtc)*
```js
// returns "2025-01-18T17:01:25.924Z"
getCivilDuskEndDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getCivilDuskEndDateTimeUtc)*
```js
returns "The sun's altitude does not drop to -6° on Wed Jun 18 2025 at latitude -75.100620 and longitude 123.354750"
getCivilDuskEndDateTimeUtc(new Date(2002, 0, 27), -75.100620, 123.354750);
```
**Example** *(Example usage of getNauticalDuskEndDateTimeUtc)*
```js
// returns The sun's altitude does not rise to -6° on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45
getCivilDuskEndDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```
* * *
## getCivilDuskStartDateTimeUtc(date, latitude, longitude) ⇒ string
Gets the start of civil dusk date and time in UTC expressed in an ISO 8601 format for date instance, latitude and longitude value.
**Kind**: global function
**Returns**: string
- A string representing the start of civil dusk date and time in UTC, expressed in an ISO 8601 format.
| Param | Type | Description |
| --- | --- | --- |
| date | Date
| A date instance. |
| latitude | number
| A latitude value in the range of -90 to 90. |
| longitude | number
| A longitude value in the range of -180 to 180. |
**Example** *(Example usage of getCivilDuskStartDateTimeUtc)*
```js
// returns "2025-01-18T16:23:11.903Z"
getCivilDuskStartDateTimeUtc(new Date(2025, 0, 18), 51.477730, -0.010150);
```
**Example** *(Example usage of getCivilDuskStartDateTimeUtc)*
```js
returns "The sun's altitude does not rise to -6° on Wed Jun 18 2025 at latitude -75.100620 and longitude 123.354750"
getCivilDuskStartDateTimeUtc(new Date(2002, 0, 27), -75.100620, 123.354750);
```
**Example** *(Example usage of getCivilDuskStartDateTimeUtc)*
```js
// returns "The sun is up all day on Sun Aug 02 2037 at latitude 71.98007 and longitude 102.47427"
getCivilDuskStartDateTimeUtc(new Date(2037, 7, 2), 71.980070, 102.474270);
```
**Example** *(Example usage of getCivilDuskStartDateTimeUtc)*
```js
// returns "The sun is down all day on Thu Jan 01 2032 at latitude 89.525 and longitude -30.45"
getCivilDuskStartDateTimeUtc(new Date(2032, 0, 1), 89.5250, -30.4500);
```