docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.79k stars 2k forks source link

time is error! #1391

Closed kingsoftbes closed 1 year ago

kingsoftbes commented 1 year ago
  $mtime0= date("Y-m-d H:i:s");
    $mtime1= date("Y-m-d H:i:s", strtotime("-1 month"));
    $mtime2= date("Y-m-d H:i:s", strtotime("+1 month"));
    var_dump('now time:'.$mtime0);
    var_dump('time1 last month:'.$mtime1);
    var_dump('time2 next month:'.$mtime2);

string(28) "now time:2023-03-31 13:43:59" string(36) "time1 last month:2023-03-03 13:43:59" string(36) "time2 next month:2023-05-01 13:43:59"

why?

tianon commented 1 year ago

Sounds like a quirk of PHP's strtotime :shrug:

Unfortunately, we do not have the bandwidth to provide in-depth integration/deployment/environment debugging or support here; these sorts of questions/requests would be more appropriately posted to a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.