remove stftime
authorAlan <alan@roojs.com>
Tue, 3 May 2022 05:47:02 +0000 (13:47 +0800)
committerAlan <alan@roojs.com>
Tue, 3 May 2022 05:47:02 +0000 (13:47 +0800)
Date/Calc.php

index 344a634..3aef7fc 100644 (file)
@@ -472,7 +472,8 @@ class Date_Calc
      */\r
     static function dateNow($format = DATE_CALC_FORMAT)\r
     {\r
-        return strftime($format, time());\r
+        $d = new Date(time());\r
+        return $d->format($format);\r
     }\r
 \r
     // }}}\r
@@ -716,7 +717,7 @@ class Date_Calc
     {\r
         $months = array();\r
         for ($i = 1; $i < 13; $i++) {\r
-            $months[$i] = strftime('%B', mktime(0, 0, 0, $i, 1, 2001));\r
+            $months[$i] = date('M', mktime(0, 0, 0, $i, 1, 2001));\r
         }\r
         return $months;\r
     }\r
@@ -742,7 +743,7 @@ class Date_Calc
     {\r
         $weekdays = array();\r
         for ($i = 0; $i < 7; $i++) {\r
-            $weekdays[$i] = strftime('%A', mktime(0, 0, 0, 1, $i, 2001));\r
+            $weekdays[$i] = date('l', mktime(0, 0, 0, 1, $i, 2001));\r
         }\r
         return $weekdays;\r
     }\r