Set server Timezone and correct time?

Hey Guys,

I have a LA based VPS running virtualmin on Centos 6. Im from New Zealand, and want to have the server running as if it was a NZ server (So NZ time).

So, is there a easy way to change this?

i went to the “System Time” module under webmin, and changed the time zone to “Pacific/Auckland” but that didnt change the time. I dont really want to manually set the time (i can), because that means it probably wont adjust automatically for daylight savings etc.

So, is there an automatic way of telling the server/virtualmin/webmin to use some specific time zone? If so, how would i go about changing that?

Also, what about the php/mysql time formats? Will they be changed automatically or do i somehow need to change timezones then reinstall the whole virtualmin system to get everything up and running on the correct time zone? Also, what would happen when daylight savings start/end?

Thanks for any help/time :slight_smile:

PHP timezone is in the php.ini file (if you already have virtual servers you’ll have to manually set each servers php.ini setting I believe as it’s copied from the default) which is at /etc/php.ini for Centos, Look for the Date.timezone setting.

Open SSH and type: “date” (without the quotes) and see what is outputted there.

In the System Time module in webmin, set the timezone and click “Save”, once that’s done set the time on the first tab under the “System Time” heading and click “apply”. Chances are your provider won’t let you set the hardware time. Mine didn’t at least and that makes sense but I’m not well versed in virtualization technologies to be 100% on that one.

Let us know if that gets you anywhere. :slight_smile:

Cool, yup, i remember setting php time zone. was wondering if there was a different way…

so the output for date was:

Sun Aug 11 14:29:28 NZST 2013

NZST seems right (since i set the time zone), and its currently August 11 (Sunday), 09:29 (AM). So the time is obviously wrong… That cant possibly be LA time either, because NZ is like 20 hours ahead of US, (so maybe correct time in LA but wrong date)…

So should i be manually setting the date/time? Or is theer any way the server can sync with some standard time thing and automatically get/sync? Because manually setting isnt accurate, and i have to manually adjust time at daylight savings…

In virtualmin System Time module, what does it list for the time there? The timezone should be right. But now i think you’ll have to at least get the time close to what it actually is. After that we can sync it like you said but we have to get it close first.

Virtualmin system module says 15:48 today, which is 5 hours ahead of where it should be.
There can’t possibly be a country with that time, since there’s not many other countries ahead of time than nz.

So I can manually change the time through the module. What do I do then?

Change the “System Time” and click apply. The timezone and time should then be correct and at least within the same hour as the time you want it to be. Confirm that with the “date” command. If it is, you can go back to the system time module, select the third tab for time server sync

I use “” for “Timeserver hostnames or addresses”. you can set the schedule however you like. I have mine set to 0:00 everyday. You can uncheck set hardware time (not sure if it would matter anyways) and then click sync and apply, run date command again and it should be correct.

Let me know how that goes.


I got to the sync tab. And I’m quite confused about how to set the schedule. There’s minutes/hours/days etc and they have selected or all and also have multiple random select options which to me isn’t really intuitive. You able to tell me how to set it to sync hourly at a say 01 of every hour like 01:01, 02:01, 03:01 etc?

Thanks heaps.

PS, I been going to the system time module from either searching system time on the search bar or clicking the current date on the virtualmin dashboard. I have a 2nd vps that I also need to set the time, but I cannot to save my life find my way to the system time module. The dashboard date time is not click able there and searching gives me 0 results :frowning: any thoughts?

It’s under “Hardware” on webmin menu

Set “Minutes” to “Selected” then select which minute(s) you want, in your case select “1”.
Set “Hours” to “All”
Set “Days”, “Months”, “Weekdays” to “All” as well.

I’ve attached a screenshot for how I have mine set (midnight everyday) as an example for you :slight_smile:

haha funny that, i was confused because i was on my phone, and for minutes there was like 4-5 dropdown boxes, i was scratching my head…

Ok, it seems to be done for server 1. Im hoping its working (i dont really have a good way to test it :P, i guess i can change the time manually and see if it will change at the sync time…)…

Server 2 (the one where i couldnt get to system time screen). As you mentioned, i went to webmin and looked under hardware, only submenu option i see is “Printer Administration”, nothing else. Any idea? Or rather, any other suggestions?

Cane accross this thread:
That guy seem to be having the same problem. VPS is a standard vps from URPad and is running centos 6

cat /etc/redhat-release
CentOS release 6.4 (Final)

My other VPS from Backupsy (same centos 6 version/output as above), works just fine, i can see the system time module under hardware etc… And under webmin -> hardware, i see lots of options here (unlike the other server showing just one)

GRUB Boot Loader
Linux RAID
Logical Volume Management
Partitions on Local Disks
Printer Administration
SMART Drive Status
System Time

When you set the time sync options it will sync right away when you click “save and sync”. So you should be able to see if the results are correct.

Not really, it could be under unused modules maybe? Besides searching for it I’m out of ideas currently.

You might want to contact your provider and ask them.

Try using the date command to set the time, if it doesn’t work you’ll have to ask your provider what they might be doing with the time. Yes it would be manually set but it’s a start :slight_smile: