ERPNext time is wrong

Hi all,

The time displayed on ERPNext is different from the time in my Server’s system. i’ve made sure that the timezone of ERPNext is correct, but they are still showing “2 hours ago”.

I’ve also checked that the MySQL server is using SYSTEM time.

any ideas?

In Settings do you have the correct time set? I’d check that first then clear cache

ERPNext is timezone aware, check the default timezone in your System Settings / User Settings

i also have this problem. My server is hosted at Google Cloud. Checked the default timezone and server time, they are correct. However, Erpnext is still showing “2 Hours ago”

I set my timezone to asia/jakarta

I am having this same issue and just like the last post, my server is hosted on google cloud. my time zone is correct. it is set to my current location. could this be the cloud host issue?

Check these for clues?
Timezone is off by a couple of hours
Timezone: Time showing in Calendar view and In from having 2:30 hrs difference

What time does your server report when you issue the command
$ timedatectl status
If your timezone is incorrect set it with
$ timedatectl set-timezone “Asia/Jakarta”

I found this interesting regarding VM overriding server time.

I didn’t realise that this could cause an issue. Maybe Google cloud does a similar thing?

1 Like

Hi @System19 when i ran the timedatectl status command, i saw the date time was off by 1 hour, reading UTC +0000. We’re on UTC+1000 or GMT+1. I then attempted to run timedatectl set-timezone “Africa/Lagos” which is my correct location and it told me invalid time zone:

admin@instance-2:/home/frappe/frappe-bench$ timedatectl status
Local time: Sun 2017-10-15 13:16:37 UTC
Universal time: Sun 2017-10-15 13:16:37 UTC
RTC time: Sun 2017-10-15 13:16:37
Time zone: UTC (UTC, +0000)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
admin@instance-2:/home/frappe/frappe-bench$ timedatectl set-timezone “Africa/Lagos”
Failed to set time zone: Invalid time zone ‘“Africa/Lagos”’
admin@instance-2:/home/frappe/frappe-bench$

this cannot be correct because in the Setup>System Setting, my time zone is set to Africa/Lagos which is one of the available time zones:

I also checked my google cloud account and the realtime cpu monitor displays the right date and time:


so i cannot say for sure where the error could be coming from.

Check the timezone in your User settings

I already did that and attached a screenshot of the current time zone settings above. i have checked through the entire system to see where the error could be but i can’t find it.

What is the timestamp in your mariadb?

  1. Save the user form

bench --site sitename mysql

select modified from tabUser order by modified desc limit 1

You could try these commands:
To list all available timezones:
$ timedatectl list-timezones
To list available timezones by a region starting with letter L:
$ timedatectl list-timezones | egrep -o “Africa/L.*”
Once you have found a place in your timezone then set your server time with:
timedatectl set-timezone “Africa/SomeWithTheSameTimeAsLagos”
Check to see that time has been changed
timedatectl
Then set UTC with
timedatectl set-timezone UTC

As a last resort I guess you could change the server time with the set-time command using HH:MM:SS
timedatectl set-time 15:55:30
Hope this helps.

Hi, I tried all the commands you gave in your post and this is what i got;

admin@homework-erp:~$ timedatectl
Local time: Wed 2017-10-18 09:32:34 WAT
Universal time: Wed 2017-10-18 08:32:34 UTC
RTC time: Wed 2017-10-18 08:32:34
Time zone: Africa/Lagos (WAT, +0100)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
admin@homework-erp:~$

The local time is now correct but the Universal time is still off by 1hour.

Sorry, I have some problem ,
Typing above command but have error á below, please assist
dungnt2000@erpnext-test-vm:~$ timedatectl status
Failed to create bus connection: No such file or directory

For your info ,I create Quotation , It show the corect create date but for naming series QTN- YYYY/MM/DD , it show 1 day ago as below image

Somehow, my VM time got off. I tried updating it with the timedatectl command, but kept getting the error, “The name org.freedesktop.PolicyKit1 was not provided by any .service files”. After some poking around on the Internet, I found someone with a similar issue (not with ERP Next) that simply put “sudo” before the command, e.g.

sudo timedatectl set-timezone “America/Denver”

That worked and got things fixed for me.

I’m not actually positive that alone fixed the problem. I should have paid better attention. I also tried:

sudo timedatectl set-time 00:07:10

But it complained that the network time was on. I did this:

sudo timedatectl set-ntp 0

Then it let me set the time manually. After that, I just put it back on:

sudo timedatectl set-ntp 1

I think it might have worked with just setting the time zone, but I thought I’d put these things in here for future reference for anyone else.