Web & Software Developer

Posts Tagged “timezones”

PHP mktime() Changes Your Time, Here’s the Fix

If you’re using PHP mktime() to make a timestamp for a specific moment in time that should not change, then be sure to first set the default timezone to UTC. Otherwise, the dynamic behavior of mktime() is to modify or change your time, based on the timezone settings on your server. This may be desirable … Read more →

IANA/Olson Time Zone Offset Search Tool

This timezone search tool lets you look up a time zone from the IANA/Olson timezone database. This calculator is mainly for looking up a historical timezone offset (time difference from UTC/GMT). That is, a timezone offset for a city for a historical date and time. A historical date is any date in the past. This … Read more →

Get Local Time in PHP with localtime

This will get the local time from the visitor’s browser. Then it converts PHP’s localtime() function into a readable display format, with leading zeros before the single-digit minutes. It also converts time into 12-hour format and appends the meridian ( am/pm ) to it. Then it displays the final time, formatted nicely, like See below … Read more →