One Year Difference using default template

Juan Sánchez5 years ago

Hello,

I've found an issue today with the date year on both telegram and mail notifications:

If i use the default Template:

$dateTool.format("YYYY-MM-dd HH:mm:ss", $event.serverTime, $locale, $timezone)

Result: 2020-12-29 05:06:48

If i change to use "long" Template:

$dateTool.long

December 29, 2019 at 5:10:52 AM CET

I check the time zone on database:

MariaDB [(none)]> SELECT @@global.time_zone;
+--------------------+
| @@global.time_zone |
+--------------------+
| SYSTEM             |
+--------------------+
1 row in set (0.001 sec)

MariaDB [(none)]> SELECT NOW();
+---------------------+
| NOW()               |
+---------------------+
| 2019-12-29 05:06:48 |
+---------------------+
1 row in set (0.002 sec)

And also, the system date is ok:
dom dic 29 05:08:01 CET 2019

How is possible to have the same date but with one year more?

Thanks for your help!!

Regards

Juan Sánchez5 years ago

Also, i put the system timedatectl result:

               Local time: dom 2019-12-29 05:31:58 CET
           Universal time: dom 2019-12-29 04:31:58 UTC
                 RTC time: n/a
                Time zone: Europe/Madrid (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Also, i have configured both attributes on user/Server with the web.

Виталий5 years ago

same problem. and yesterday everything was fine

richard5 years ago

I'm facing this problem too

Abdul5 years ago

Problem occurs due to this week being classified as week 1 of 2020. Using small ("yyyy") may solve the problem but I have not tested. Once someone has tested please post.

Juan Sánchez5 years ago

Yes!!! I've tested with small letters (yyyy) and it's ok!