25 March 2020

WordPress – Set Timezone

I had originally thought that by setting the timezone on a Bitnami server that WordPress would then pull and use that time info. Oh, I was so wrong! It wasn’t a bad exercise, as at least I’ll be able to better read my logs in a more “timely” manner. LOL. But it turns out that setting the timezone info for WordPress is much simpler and doesn’t involve any need to console in or SSH to the server. Lets get started…

Log in with an account that has admin privileges to your WordPress dashboard. In the dashboard menu that is on the left side, navigate to “Settings” then click on “General”

The fifth item down from the top of this page is “Timezone”. Use the dropdown menu to select your desired timezone. Then click the “Save Changes” button at the very bottom of the page. I’m choosing “Honolulu” as my desired timezone.

That’s it! Your WordPress posts will now all reflect the local time you chose as your timezone. It couldn’t be any simpler than that!

25 March 2020

Bitnami – Set timezone

Having the correct timezone configured on your machine can save you a lot of “math headaches” when you try to comb through the machine’s event logs. It’s a pretty easy thing to configure in the overall scope of all things, yet it is one that is often over looked, even by veteran users. Never fear though… I will show you how you too can update your Bitnami instance to your preferred timezone.

Lets begin by logging in with ‘root’ priviledges to your Bitnami instance.
Once logged in, use the following command to see what timezone you are currently set to use.

date

As you can see in my example, I am currently set to the UTC timezone, also known as Universal Time.

To find our desired timezone and reconfigure this, we need to enter the following command.

sudo dpkg-reconfigure tzdata

Once you’ve entered the command above and hit ‘Enter’ it will launch a menu were we can find and select your desired timezone. I will changing my Bitnami instance to use the ‘Pacific\Honolulu’ timezone, also known as HST.

Once you click ‘OK’, the machine will show you that it has updated it’s clock to use your desired timezone.

You can further verify that your clock is set correctly by running the ‘date’ command again, just as we had at the beginning of this post.

date

Just like that, we have updated the timezone preference in Bitnami. It was simple to do just as i promised. No more “math headaches” for us when we read log timestamps!!!

NOTE: If you are just trying to update your timezone for WordPress that is running on Bitnami, then check out this post of mine: WordPress – Set Timezone

Category: AWS, Bitnami | LEAVE A COMMENT
25 March 2020

PhotonOS – Set timezone

PhotonOS is VMware’s minimalist Linux based OS that has been heavily optimized for vSphere environments. Many of VMware’s appliance and OVAs are based on this super light weight platform. The problem with appliances and OVAs, is that I have yet to find or launch one that is set to MY timezone by default. I guess that is the price I have to pay for living in Hawaii.

While having the timezone mis-configured probably won’t hurt the VM itself most of the time, it definitely makes reading timestamps and logs more difficult. I mean come on, we’ve all been there before, add or subtracting your timezone offset to figure out what time an event actually happened since we probably don’t live in the GMT or UTC timezones. Much to our luck, setting the timezone PhotonOS using SSH (or the console’s CLI) is pretty easy after you log in as ‘root’.

Enter the command below to get a list of all available timezones.

ls -lsa /usr/share/zoneinfo | more

If you live in a region that is divided into subregions, such as the ‘Pacific’, we can use the following command instead to list those zones.

ls -lsa /usr/share/zoneinfo/Pacific | more

Once you have found the name of your desired timezone you can use the following command to set it. I’m using “Pacific/Honolulu” as my desired timezone.

set Pacific/Honolulu timezone

Then make a symbolic link from localtime to “Pacific/Honolulu”, or your desired timezone…

ln -sf /usr/share/zoneinfo/Pacific/Honolulu /etc/localtime

The final step is to check and visually confirm that the timezone is correct. To do this, we simply run the following command.

date

Now we can finally make some sense out of our logs!!!