Last active
January 6, 2024 08:35
-
-
Save tronsha/004c37a26bbf3870e9b6 to your computer and use it in GitHub Desktop.
Aventurisches Datum für Das Schwarze Auge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dayOfTheYear = date('z'); | |
if ((date('L') == 1) && ($dayOfTheYear >= 60)) { | |
$dayOfTheYear = $dayOfTheYear - 1; | |
} | |
$avMonthList = array( | |
'Praios', | |
'Rondra', | |
'Efferd', | |
'Travia', | |
'Boron', | |
'Hesinde', | |
'Firun', | |
'Tsa', | |
'Phex', | |
'Peraine', | |
'Ingerimm', | |
'Rahja', | |
'Tag des Namenlosen' | |
); | |
$avDayOfTheWeekModifier = array( | |
'0', | |
'2', | |
'4', | |
'6', | |
'8', | |
'10', | |
'12', | |
'14', | |
'16', | |
'18', | |
'20', | |
'22', | |
'24' | |
); | |
$avDayOfTheWeekList = array( | |
'Erdtag', | |
'Markttag', | |
'Praiostag', | |
'Rohalstag', | |
'Feuertag', | |
'Wassertag', | |
'Windstag' | |
); | |
$avDay = $dayOfTheYear % 30 + 1; | |
$avMonth = $avMonthList[(int)floor($dayOfTheYear / 30)]; | |
$avYear = date('Y') - 1970; | |
$avDayOfTheWeekHelper = $avDay + $avDayOfTheWeekModifier[(int)floor($dayOfTheYear / 30)] + ($avYear % 28); | |
$avDayOfTheWeek = $avDayOfTheWeekList[($avDayOfTheWeekHelper % 7)]; | |
$avYear = $avYear + 993; | |
echo $avDayOfTheWeek . ', ' . $avDay . '. ' . $avMonth . ' ' . $avYear . ' BF'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment