[Znote AAC] Change months language

Discussion in 'Website Applications' started by Webo, Dec 29, 2016.

Tags:
  1. Webo

    Webo Otland 4ever

    Joined:
    Oct 20, 2013
    Messages:
    562
    Likes Received:
    180
    Best Answers:
    5
    Special thanks to @Znote for help
    PHP:
    1. function getClock($time = false, $format = false, $adjust = true) {
    2.     if ($time === false) $time = time();
    3.     // Date string representation
    4.     $date = "d F Y (H:i)"; // 15 July 2013 (13:50)
    5.     if ($adjust) $adjust = (1 * 3600); // Adjust to fit your timezone.
    6.     else $adjust = 0;
    7.     if ($format) {
    8.         $EnglishMonth = date("F", $time+$adjust);
    9.         // Will be translated to polish in switch statement
    10.         $PolishMonth = $EnglishMonth;
    11.         switch ($EnglishMonth) {
    12.             case 'January':
    13.                 $Polishmonth = "PolishJanuary";
    14.                 break;
    15.             case 'February':
    16.                 $Polishmonth = "PolishFebruary";
    17.                 break;
    18.             // And so on....
    19.             case 'December':
    20.                 $Polishmonth = "PolishDecember";
    21.                 break;
    22.         }
    23.         return str_replace($EnglishMonth, $Polishmonth, date($date, $time+$adjust));
    24.     }
    25.     else {
    26.         return $time+$adjust;
    27.     }
    28. }
     
  2. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,740
    Likes Received:
    565
    Best Answers:
    7
  3. Webo

    Webo Otland 4ever

    Joined:
    Oct 20, 2013
    Messages:
    562
    Likes Received:
    180
    Best Answers:
    5
    what you have entered will not work here
     
  4. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,740
    Likes Received:
    565
    Best Answers:
    7
    lmao gl with it, btw it should work, but you do no effort
     
    Webo likes this.
  5. Webo

    Webo Otland 4ever

    Joined:
    Oct 20, 2013
    Messages:
    562
    Likes Received:
    180
    Best Answers:
    5

Share This Page

Loading...