In den Maya-Kalender konvertieren
Identifzieren Sie die Epoche (oder das Anfangsdatum) der Langen Zählung der Maya als Julianisches Datum.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_59.png)
epoch = JulianDate["Modified",
DateObject[{-3114, 8, 11}, TimeZone -> 0]];
Erstellen Sie eine Funktion, um Einheiten der Langen Zählung in ein Julianisches Datum zu konvertieren.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_60.png)
JulianFromMayanLongCount[{baktun_, katun_, tun_, uinal_, kin_}] :=
epoch + 144000*baktun + 7200*katun + 360*tun + 20*uinal + kin
FromJulianDate kann verwendet werden, um eine Beispieleingabe zu testen.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_61.png)
example = JulianFromMayanLongCount[{7, 17, 18, 19, 2}]
![](assets.de/convert-to-the-mayan-calendar/O_54.png)
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_62.png)
FromJulianDate["Modified", example, TimeZone -> 0]
![](assets.de/convert-to-the-mayan-calendar/O_55.png)
Erstellen Sie eine Funktion, um Datumsobjekte direkt von der Langen Zählung der Maya in den gregorianischen Kalender zu konvertieren.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_63.png)
GregorianFromMayanLongCount[date_] := DateValue[
FromJulianDate["Modified",
JulianFromMayanLongCount[date],
TimeZone -> 0],
"Day",
DateObject]
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_64.png)
GregorianFromMayanLongCount[{7, 17, 18, 19, 2}]
![](assets.de/convert-to-the-mayan-calendar/O_56.png)
Erstellen Sie eine Funktion, um ein julianisches Datum in Einheiten der Langen Zählung zu konvertieren.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_65.png)
JulianToMayanLongCount[date_] := NumberDecompose[
Floor[date - epoch],
{144000, 7200, 360, 20, 1}
]
JulianDate kann verwendet werden, um Datumseingaben aller Art in ein julianisches Datum zu konvertieren, das anschließend in JulianToMayanLongCount eingefügt wird.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_66.png)
DateToMayanLongCount[date_] := Block[{$TimeZone = 0},
JulianToMayanLongCount[JulianDate["Modified", date]]
]
Diese Funktion akzeptiert nun jedes beliebige Eingabedatum und gibt die entsprechende Datumsliste der Langen Zählung zurück.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_67.png)
DateToMayanLongCount["May 4th, 2015"]
![](assets.de/convert-to-the-mayan-calendar/O_57.png)
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_68.png)
DateToMayanLongCount[AbsoluteTime[]]
![](assets.de/convert-to-the-mayan-calendar/O_58.png)
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_69.png)
DateToMayanLongCount[Today]
![](assets.de/convert-to-the-mayan-calendar/O_59.png)
Diese beiden Funktionen können verwendet werden, um Datumsangaben in die und aus der Langen Zählung zu konvertieren.
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_70.png)
DateToMayanLongCount[{1900, 1, 1}]
![](assets.de/convert-to-the-mayan-calendar/O_60.png)
![Click for copyable input](assets.de/convert-to-the-mayan-calendar/In_71.png)
DateToMayanLongCount[{1900, 1, 1}];
GregorianFromMayanLongCount[%]
![](assets.de/convert-to-the-mayan-calendar/O_61.png)