Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
It seems that with the recent 8.x-4.1-rc1 update, the timestamp is using GMT hour whatever the website timezone setting is.
For example, here in Paris, France, today's backup at 10:08:03 CET with 'Ymd-His' timestamp has been labelled 20180223-090803.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#4 | Issue #2947219_#3_Make_timestamp_use_local_time.patch | 618 bytes | bryrock |
Comments
Comment #2
PhilYComment #3
bryrock CreditAttribution: bryrock as a volunteer commentedI will add a patch for this momentarily.
Comment #4
bryrock CreditAttribution: bryrock as a volunteer commentedHere's a patch to get the timestamp from local time instead of GMT.
Comment #5
bryrock CreditAttribution: bryrock as a volunteer commentedComment #7
bryrock CreditAttribution: bryrock as a volunteer commentedThe patch passes when tested with the correct test (the default test for this module is set to unsupported PHP version for Drupal 8).
The module is using php function "gmdate" which always results in greenwich time. According to php manual, "Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)."
The only change needed to get the timestamp to run on local time is:
- $name .= '-' . gmdate($this->confGet('timestamp_format'));
+ $name .= '-' . date($this->confGet('timestamp_format'));
In other words, change gmdate() to date(). That's it.
(It also works)
Comment #8
Alex Andrascu CreditAttribution: Alex Andrascu commentedComment #9
DamienMcKennaComment #10
DamienMcKennaCommitted. Thanks.
Comment #13
PhilYHaving been away for a while, I just want to thank you for fixing: it works!