• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Znote AAC] Change months language

Webo

Otland 4ever
Joined
Oct 20, 2013
Messages
621
Solutions
10
Reaction score
229
Location
Warsaw
Special thanks to @Znote for help
PHP:
function getClock($time = false, $format = false, $adjust = true) {
    if ($time === false) $time = time();
    // Date string representation
    $date = "d F Y (H:i)"; // 15 July 2013 (13:50)
    if ($adjust) $adjust = (1 * 3600); // Adjust to fit your timezone.
    else $adjust = 0;
    if ($format) {
        $EnglishMonth = date("F", $time+$adjust);
        // Will be translated to polish in switch statement
        $PolishMonth = $EnglishMonth;
        switch ($EnglishMonth) {
            case 'January':
                $Polishmonth = "PolishJanuary";
                break;
            case 'February':
                $Polishmonth = "PolishFebruary";
                break;
            // And so on....
            case 'December':
                $Polishmonth = "PolishDecember";
                break;
        }
        return str_replace($EnglishMonth, $Polishmonth, date($date, $time+$adjust));
    }
    else {
        return $time+$adjust;
    }
}
 
Back
Top