KHolidays 5.109.0
Functions
KHolidays::SunRiseSet Namespace Reference

Methods for determining the sunrise and sunset times for a given date and Earth location. More...

Functions

bool isPolarDay (const QDate &date, double latitude)
 Checks whether it is polar day on day date at latitude.
 
bool isPolarNight (const QDate &date, double latitude)
 Checks whether it is polar night on day date at latitude.
 
bool isPolarTwilight (const QDate &date, double latitude)
 Checks whether it is polar twilight on day date at latitude.
 
QTime utcDawn (const QDate &date, double latitude, double longitude)
 Compute the civil dawn time (UTC) for a date and Earth location.
 
QTime utcDusk (const QDate &date, double latitude, double longitude)
 Compute the civil dawn time (UTC) for a date and Earth location.
 
QTime utcSunrise (const QDate &date, double latitude, double longitude)
 Compute the sunrise time (UTC) for a date and Earth location.
 
QTime utcSunset (const QDate &date, double latitude, double longitude)
 Compute the sunset time (UTC) for a date and Earth location.
 

Detailed Description

Methods for determining the sunrise and sunset times for a given date and Earth location.

Function Documentation

◆ isPolarDay()

bool KHolidays::SunRiseSet::isPolarDay ( const QDate &  date,
double  latitude 
)

Checks whether it is polar day on day date at latitude.

That is, the sun stays above -0.83° relative to the horizon at all times. Both sunrise/sunset and dawn/dusk times will be invalid for such a day.

Parameters
latitudein degree (-90.0, 90.0)
See also
isPolarNight(), isPolarTwilight()
https://en.wikipedia.org/wiki/Midnight_sun
Since
5.97

◆ isPolarNight()

bool KHolidays::SunRiseSet::isPolarNight ( const QDate &  date,
double  latitude 
)

Checks whether it is polar night on day date at latitude.

That is, the sun stays below -6° relative to the horizon at all times. Both sunrise/sunset and dawn/dusk times will be invalid for such a day.

Parameters
latitudein degree (-90.0, 90.0)
See also
isPolarDay(), isPolarTwilight()
https://en.wikipedia.org/wiki/Polar_night
Since
5.97

◆ isPolarTwilight()

bool KHolidays::SunRiseSet::isPolarTwilight ( const QDate &  date,
double  latitude 
)

Checks whether it is polar twilight on day date at latitude.

That is, the sun rises at least above -6° relative the horizon during the day, but remains below -0.83° at all times. Sunrise/sunset times will be invalid for such a day, but dawn/dusk times will be available.

Parameters
latitudein degree (-90.0, 90.0)
See also
isPolarDay(), isPolarNight()
https://en.wikipedia.org/wiki/Polar_night
Since
5.97

◆ utcDawn()

QTime KHolidays::SunRiseSet::utcDawn ( const QDate &  date,
double  latitude,
double  longitude 
)

Compute the civil dawn time (UTC) for a date and Earth location.

Parameters
dateis any valid QDate.
latitudeis a floating point representing a valid latitude (-90.0, 90.0)
longitudeis a floating point representing a valid longitude (-180.0, 180.0)
See also
https://en.wikipedia.org/wiki/Twilight
Returns
the QTime of the sunrise in UTC.
Note
the latitude and longitude are truncated as needed to fit into their proper range.
Since
5.77

◆ utcDusk()

QTime KHolidays::SunRiseSet::utcDusk ( const QDate &  date,
double  latitude,
double  longitude 
)

Compute the civil dawn time (UTC) for a date and Earth location.

Parameters
dateis any valid QDate.
latitudeis a floating point representing a valid latitude (-90.0, 90.0)
longitudeis a floating point representing a valid longitude (-180.0, 180.0)
See also
https://en.wikipedia.org/wiki/Twilight
Returns
the QTime of the sunset in UTC.
Note
the latitude and longitude are truncated as needed to fit into their proper range.
Since
5.77

◆ utcSunrise()

QTime KHolidays::SunRiseSet::utcSunrise ( const QDate &  date,
double  latitude,
double  longitude 
)

Compute the sunrise time (UTC) for a date and Earth location.

Parameters
dateis any valid QDate.
latitudeis a floating point representing a valid latitude (-90.0, 90.0)
longitudeis a floating point representing a valid longitude (-180.0, 180.0)
Returns
the QTime of the sunrise in UTC.
Note
the latitude and longitude are truncated as needed to fit into their proper range.

◆ utcSunset()

QTime KHolidays::SunRiseSet::utcSunset ( const QDate &  date,
double  latitude,
double  longitude 
)

Compute the sunset time (UTC) for a date and Earth location.

Parameters
dateis any valid QDate.
latitudeis a floating point representing a valid latitude (-90.0, 90.0)
longitudeis a floating point representing a valid longitude (-180.0, 180.0)
Returns
the QTime of the sunset in UTC.
Note
the latitude and longitude are truncated as needed to fit into their proper range.