# implementing the Mayan Calender

This topic is 5722 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Perhaps somebody has the time to dig into the mayan calender and is able to create the code for translating the Gregorian calender into the 260 days Mayan Calender. Which is 10,000th of a day more exact than the standard calender we use today.

Calculating the 12 months 365 days into 18 months of 20 days with 5 days in the 19th month (aka the 13 moon 28-day wavespell calendar 364+1).

And to make it even more easy, not to forget the +1 day every year that needs to be added (Day out of Time).

The Sacred Round of 260 days is composed of two smaller cycles: the numbers 1 through 13, coupled with 20 different day names. Each of the day names is represented by a god who carries time across the sky, thus marking the passage of night and day.

The year 2012 is getting close so hopefully somebody can help me figure out the code/script as it becomes more important.

Hope you will enjoy these links:

Calculators

Tutorials

Calender info

Maya Info

2012

##### Share on other sites

'Fraid I will have to pass on this one.....I always struggle with dates.

Phil :wink2:

##### Share on other sites

According to this,

"The authorities disagree on what 13.0.0.0.0 corresponds to in our calendar."

I have picked one the three possible matches, which seems to agree with the Fourmilab calculator

Let ( [

serialDay = GetAsNumber ( Date ) + 1137142 ;

// LONG COUNT

baktunN = Div ( serialDay ; 144000 ) ;

baktun = Mod ( baktunN - 1 ; 13 ) + 1 ;

baktunR = Mod ( serialDay ; 144000 ) ;

katun = Div ( baktunR ; 7200 ) ;

katunR = Mod ( baktunR ; 7200 ) ;

tun = Div ( katunR ; 360 ) ;

tunR = Mod ( katunR ; 360 ) ;

uinal = Div ( tunR ; 20 ) ;

kin = Mod ( tunR ; 20 ) ;

// TZOLKIN

weekNumber = Mod ( serialDay + 3 ; 13 ) + 1 ;

dayName = Choose ( kin ; "Ahau" ; "Imix" ; "Ik" ; "Akbal" ; "Kan" ; "Chicchan" ; "Cimi" ; "Manik" ; "Lamat" ; "Muluc" ; "Oc" ; "Chuen" ; "Eb" ; "Ben" ; "Ix" ; "Men" ; "Cib" ; "Caban" ; "Etznab" ; "Caunac" ) ;

// HAAB

dayOfYear = Mod ( serialDay - 17; 365 ) ;

month = Div ( dayOfYear ; 20 ) ;

day = Mod ( dayOfYear ; 20 ) ;

monthName = Choose ( month ; "Pop" ; "Uo" ; "Zip" ; "Zotz" ; "Tzec" ; "Xul" ; "Yaxkin" ; "Mol" ; "Chen" ; "Yax" ; "Zac" ; "Ceh" ; "Mac" ; "Kankin" ; "Muan" ; "Pax" ; "Kayab" ; "Cumku" ; "Uayeb" )

] ;

"Long Count: " & baktun & "." & katun & "." & tun & "." & uinal & "." & kin & ¶ &

"Tzolkin: " & weekNumber & " " & dayName & ¶ &

"Haab: " & day & " " & monthName

)

##### Share on other sites

Seems to be working like a charm!

##### Share on other sites

I created a Wavespell birthday calculator.

If it interests you, go and have a look.

##### Share on other sites

This topic is 5722 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account