Calendar Formulae

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Calendar Formulae

All calculations are real number operations unless specifically stated otherwise.
div indicates integer division
mod indicates integer modulus
Utility formulae
Floating-point modulus
mod(, )


Time-of-day formulae
, 0 < 1
Time-of-day from hours, minutes, seconds
tod(, , )
+60 ( +60 )
24 60 60

Hours, minutes, seconds, from time-of-day
hms()
24 60 60 +0.5
(60 60)
( 60) 60
60
Julian Date (JD) and Julian Day Number (JDN) formulae
Any operation that takes a JD can take a JDN without modification.
Day of week from Julian Date (JD)
DayOfWeek() mod( + 0.5,7)
Time-of-day from Julian Date (JD)
tod() ( +0.5) + 0.5
HMS from Julian Date (JD)
hms() hms()
( +0.5) +0.5

Julian Day Number (JDN) from Julian Date (JD)
The JDN is the JD adjusted to 12 am (0:00:00) of that given day.
jdn() +0.5 0.5
Gregorian calendar formulae

[1. .12]
[1. .31]
[0. .6], 0 =
= 1,721,425.5
Gregorian (G) Leap-year
leapyear() ( 4 = 0) ( 100 0) ( 400 = 0)
Gregorian (G) add months (n)
gregorianAddMonths(, , , )
= + 12
= + 12
= ( 1) 12 +(12) 12
= +
= 12
= min (, (, ()))
Gregorian (G) add years (n)
gregorianAddYears(, , , )
= +
=
=
( = 2 = 29 () ) ( = 28)
Gregorian to JDN (Integer implementation)
jdn(, , )
(14 ) 12
+4800
+12 3
+(153 +2) 5 +365 + 4 100 + 400 32045.5
Gregorian to JDN (Floating-point implementation)
All variables are real numbers
1
{
0, 2
1, > 2
2, > 2

1 + 365 +

4


100
+

400
+
367 362
12
+ +
JD to Gregorian (Integer implementation)
gregorian()
0.5 +0.5
+0.5 +32044
(4 +3) 146097
(146097 ) 4
(4 +3) 1461
1461 4
(5 +2) 153
(153 + 2) 5 +1
+3 12 ( 10)
100 + 4800 + 10
Gregorian to JD (with H:M:S)
jd(, , , , , )
jdn(, , )
tod(, , )
+
JD to Gregorian (with H:M:S)
gregorianWithHMS()

gregorian()
hms()
Julian calendar formulae

[1. .12]
[1. .31]
[0. .6], 0 =
= 1,721,423.5
Julian (J) Leap-year
leapyear() ( 4 = 0)
Julian (J) add months (n)
julianAddMonths(, , , )
+ 12
+ 12
( 1) 12 +(12) 12
+
12
min (, (, ()))
Julian (J) add years (n)
julianAddYears(, , , )
+


( = 2 = 29 () ) ( 28)
Julian to JDN (Integer implementation)
jdn(, , )
(14 ) 12
+4800
+12 3
+(153 +2) 5 +365 + 4 32083.5
JD to Julian
julian()
+0.5
+1524

122.1
365.25

365.25


30.6001

{
< 14 1
14 13

{
> 2 4716
2 4715

30.6001
Julian to JD (with H:M:S)
jd(, , , , , )
jdn(, , )
tod(, , )
+
JD to Julian (with H:M:S)
julianWithHMS()

julian()
hms()
Islamic calendar formulae

[1. .12]
[1. .30]
[0. .6], 0 =

, 1 =

, 2 = ,
3 =

, 4 = , 5 = `, 6 =
= 1,948,439.5
Calendar dates run from noon to noon.
Weekday names are used from midnight to midnight.
Islamic (I) Leap-year
leapyear() mod((11 ) +14,30) < 11
Islamic (I) Days in month
dayInMonth(, ) ( ) ( = 12 )
Islamic (J) add months (n)
islamicAddMonths(, , , )
+ 12
+ 12
( 1) 12 +(12) 12
+
12
min (, (, ()))
Islamic (I) add years (n)
islamicAddYears(, , , )
+


( = 12 = 30 () ) ( 29)
Islamic (I) to JDN
jdn(, , )
+29.5 ( 1) +( 1) 354 +
3 +11
30
+ 1
JD to Islamic
islamic()
+0.5

30 ( ) +10646
10631

min (12,
(29 +jdn(, 1,1))
29.5
+1)
jdn(, , 1) +1
Islamic to JD (with H:M:S)
jd(, , , , , )
jdn(, , )
tod(, , )
0.5 1
+
JD to Islamic (with H:M:S)
islamicWithHMS()

islamic()
hms()

Hebrew calendar formulae

[1. .13]
[1. .30]
= 347,995.5
Calendar dates run from noon to noon.
Weekday names are used from midnight to midnight.
Hebrew (H) leap-year
leapyear() mod(7 +1,19) < 7
Hebrew (H) months in year
monthsInYear()
12
() +1
Hebrew (H) delay of week
delayOfWeek()

235 234
19

12084 +13753
29 +

25920

mod(3 ( +1), 7) < 3 +1
Hebrew (H) delay adjacent year
delayAdjacentYear()
delayOfWeek( 1)
delayOfWeek()
delayOfWeek( +1)
0
= 356 2
( 356) ( = 382) 1

Hebrew (H) days in year
daysInYear() jdn( +1,7,1) jdn(, 7,1)
Hebrew (H) days in month
daysInMonth(, )
= 2 = 4 = 6 = 10 = 13 29
= 12 () 29
= 8 mod(daysInYear(), 10) 5 29
= 9 mod(daysInYear(), 10) = 3 29
30
Hebrew (H) to JDN
jdn(, , )
+delayOfWeek() +delayAdjacentYear() + +1
< 7
[7. . ()], +daysInMonth(, )
[1. . 1], +daysInMonth(, )

7 [7. . 1], +daysInMonth(, )
JD to Hebrew
hebrew()
+0.5

( ) 98496
35975351

1

jdn(, 7,1) +1, +1
1
< jdn(, 1,1) 7
first

> jdn(, , daysInMonth(, ) +1, +1
jdn(, , 1 +1
Hebrew to JD (with H:M:S)
jd(, , , , , )
jdn(, , )
tod(, , )
0.5 1
+
JD to Hebrew (with H:M:S)
islamicWithHMS()

hebrew()
hms()
Star Trek Vulcan Calendar Formulae
Terms
Rtas: Vulcan year (R)
TKuhati: Vulcan month (TK)
TVed: Vulcan day (TV)
Vhral: Vulcan hour (Vh)
lirtk: Vulcan minute (lk)
likrt: Vulcan second (lt)
Conversions
1 R = 12 TK = 252 TV = 266.4 Earth day
1 TK = 21 TV
1 TV = 18Vh
1 Vh = 54 lk
1 lk = 54 lt
Month Names
1 Zat
2 Druh
3 KriBrax
4 reTKhutai
5 TkeKhuti
6 Khuti
7 TaKrat
8 Krilior
9 etkhior
10 Tlakht
11 TkeTas
12 Tasmeen
Conversions
Zat 1, 9051 0:0:0 = December 11, 2364 12:0:0 = JD 2584838
Epoch
Zat 1, 1 = JD 173651.6

You might also like