Things to do in Cape Town, the Helderberg, and the Cape Winelands

Tag time

PHP: How to Add Days, Months or Years to a Date

Date work is always icky, but luckily PHP has some pretty nifty functions that can pretty much do all the heavy lifting for you. One of most commonly faced problems is how to add either a number of days, months… Continue Reading →

Ensure that an Ubuntu PC’s Time Stays Correct and Up-to-date

Some older machines suffer from a system clock that systematically loses time, resulting in your operating system, in this case Ubuntu, displaying the incorrect time and in the process causing you to be late for all you carefully scheduled appointments,… Continue Reading →

JavaScript: Calculate the Number of Days in a Month

A simple way to calculate how many days are in a month in Javascript is to leverage Javascript’s built in date overflow feature – basically if you give it an incorrect date it automatically adjusts it to the correct one by assuming that the overflow are days which need simply to be added to the given date.

JavaScript: Calculate the Number of Days in Last Month and Set a Date Range for it

A simple way to calculate how many days are in a month in Javascript is to leverage Javascript’s built in date overflow feature – basically if you give it an incorrect date it automatically adjusts it to the correct one by assuming that the overflow are days which need simply to be added to the given date.

Ubuntu: How to View the Current Date and Time via Command Line

If you are working on an Ubuntu server installation that comes in the command line only variation, you might at any point in time want to see just what exactly the server’s time is currently set to.

PHP: How to add a Hour to the Current Time

Adding an hour to the current time turns out to be pretty easy thanks to the fantastic strtotime PHP function.

© 2021 An Exploring South African — Powered by WordPress