astro-0.4.3.0: Amateur astronomical computations
CopyrightAlexander Ignatyev 2016
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Astro.Time.JulianDate

Description

Julian date is the continuous count of days since noon on January 1, 4713 BC, the beginning of the Julian Period.

Examples

JulianDate

import Data.Astro.Time.JulianDate

-- 2017-06-25 9:29:00 (GMT)
jd :: JulianDate
jd = fromYMDHMS 2017 6 25 9 29 0
-- JD 2457929.895138889

LocalCiviTime and LocalCivilDate

import Data.Astro.Time.JulianDate
import Data.Astro.Types

-- 2017-06-25 10:29:00 +0100 (BST)
lct :: LocalCivilTime
lct = lctFromYMDHMS (DH 1) 2017 6 25 10 29 0
-- 2017-06-25 10:29:00.0000 +1.0

lctJD :: JulianDate
lctJD = lctUniversalTime lct
-- JD 2457929.895138889

lctTZ :: DecimalHours
lctTZ = lctTimeZone lct
-- DH 1.0

lcd :: LocalCivilDate
lcd = lcdFromYMD (DH 1) 2017 6 25

lcdJD :: JulianDate
lcdJD = lcdDate lcd
-- JD 2457929.5

lcdTZ :: DecimalHours
lcdTZ = lcdTimeZone lcd
-- DH 1.0
Synopsis

Documentation

newtype JulianDate Source #

A number of days since noon of 1 January 4713 BC

Constructors

JD TimeBaseType 

julianStartDateTime :: JulianDate Source #

Beginning of the Julian Period

data LocalCivilTime Source #

Represents Local Civil Time

data LocalCivilDate Source #

Local Civil Date, used for time conversions when base date is needed

Constructors

LCD 

Instances

Instances details
Eq LocalCivilDate Source # 
Instance details

Defined in Data.Astro.Time.JulianDate

numberOfDays :: JulianDate -> JulianDate -> TimeBaseType Source #

Return number of days since the first argument till the second one

numberOfYears :: JulianDate -> JulianDate -> TimeBaseType Source #

Return number of years since the first argument till the second one

numberOfCenturies :: JulianDate -> JulianDate -> TimeBaseType Source #

Return number of centuries since the first argument till the second one

fromYMD :: Integer -> Int -> Int -> JulianDate Source #

Create Julian Date. It takes year, month [1..12], Day [1..31].

fromYMDHMS :: Integer -> Int -> Int -> Int -> Int -> TimeBaseType -> JulianDate Source #

Create Julian Date. It takes year, month [1..12], Day [1..31], hours, minutes, seconds.

toYMDHMS :: JulianDate -> (Integer, Int, Int, Int, Int, TimeBaseType) Source #

It returns year, month [1..12], Day [1..31], hours, minutes, seconds.

dayOfWeek :: JulianDate -> Int Source #

Get Day of the Week: 0 is for Sunday, 1 for Monday and 6 for Saturday

splitToDayAndTime :: JulianDate -> (JulianDate, JulianDate) Source #

Extract Day and Time parts of Date

lctFromYMDHMS :: DecimalHours -> Integer -> Int -> Int -> Int -> Int -> TimeBaseType -> LocalCivilTime Source #

Create LocalCivilTime from tize zone, local year, local month, local day, local hours, local minutes and local seconds.

lctToYMDHMS :: LocalCivilTime -> (Integer, Int, Int, Int, Int, TimeBaseType) Source #

Get from LocalCivilTime local year, local month, local day, local hours, local minutes and local seconds.

printLctHs :: LocalCivilTime -> String Source #

Print local civil time in machine readable format