 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Stephen Colebourne's Blog: Time-zone database down
by Chris Cornutt October 07, 2011 @ 12:48:02
In a new post to Stephen Colebourne's blog today, there's some bad news for developers of software and OSes in general - the timezone database that most software uses is down due to a copyright struggle with a company named Astrolabe, Inc.. How does this relate to PHP? It's the same database the language uses to define its timezones as a part of the DateTime functionality.
The time-zone database (sometimes referred to as the Olson database) is the computing world's principle source of time-zone data. It is embedded in every Unix and Java for starters, and will be used by many websites and probably by your iPhone. You may know it via the IDs, such as "Europe/London" or "America/New_York". But, perhaps you're thinking that time-zones don't change? Well that may be true for America and the EU right now, but certainly isn't for the rest of the world.
Astrolabe claims that the database is a part of the work on their "ACS Atlas" product and the contents of it belong to them.
The impact of this is severe for anyone that uses it - whether via Java, Unix or some other means. This really is the key tool used by everyone to tell the right time globally. We all owe a debt of gratitude to the database maintainers who have worked on this for many, many years at zero cost to the industry and for zero financial gain.
Stephen puts out a call to some of the larger technology leaders/companies to help resolve this situation and/or provide a resource where this information can once again be accessed freely.
voice your opinion now!
timezone database astrolabe copyright shutdown
Ibuildings techPortal: Tips for Working with DateTime in PHP
by Chris Cornutt May 04, 2010 @ 13:33:29
In the latest post from the Ibuildings techPortal Lorna Mitchell takes a look at one of the more powerful features included in PHP versions 5.2 and greater - the DateTime class.
In the newer PHP 5.3 versions even more excellent functionality was added. This is a short post to introduce this functionality with a focus on the methods available in PHP 5.2 showing some simple examples of how we can more easily manipulate and display dates without needing to work with timestamps.
She shows how to create a simple DateTime object, how to change up the timezone information related to it and has an example of how to output the format with a call to the format function. She also mentions how they can simplify the storage of date information in a database since they can be moved around between timezones easily (instead of having to calculate the different between where it was created and where it's being used).
voice your opinion now!
datetime tip tutorial example timezone
Zend Framework By Examples: Handling dates and times (Zend_Date)
by Chris Cornutt January 22, 2010 @ 11:09:45
The Zend Framework By Examples site has posted a recent tutorial about using the Zend_Date component of the Zend Framework to work with dates and times in your PHP applications.
In this example, we get or set dates in different timezones. We display parts of dates and times in various formats. We also get information on sunrise and sunset in several locations.
They also incorporate other components in the examples including Zend_Cache, Zend_Locate and Zend_Registry. Their examples show how to check the locale, verify the timezone and figure out a "date from now". Complete code is included - it's not the best method to handle some parts of the example, but it's a rough guide in the right direction.
voice your opinion now!
zenddate zendframework tutorial timezone
Vancouver Web Consultants Blog: Getting Time Zone from Latitude & Longitude
by Chris Cornutt May 08, 2009 @ 11:15:30
On the Vancouver Web Consultants blog there's this new tutorial about grabbing latitude and longitude information for a location and determining its current time zone from there.
I was recently tasked with building an application that relied heavily on accurate time zone conversions. I, like many people I soon found out, thought there were just a handful of timezones and the usual select list would suffice. The deeper I looked into the problem, the deeper it got: the list above only shows a few time offsets from UTC, but it doesn't tell me, beyond a shadow of a doubt, exactly what time it is where the user is situated, nor can I rely on that time for calculations in the future. The fact is, here are a LOT of timezones in the world.
He came across the DateTimeZone class PHP has to offer and was happy to see it met his needs. Unfortunately, users weren't always sure what timezone they were in, so he came up with a system combining Google's Maps API and GeoNames.org. He includes the code for both the PHP and Javascript sides (the Javascript requires Mootools, but it could be easily adapted to any other Javascript libraries).
voice your opinion now!
timezone latitude longitude googlemaps geonames datetimezone
Terry Chay's Blog: How much does a date() cost?
by Chris Cornutt May 07, 2009 @ 11:18:28
In a new post to his blog Terry Chay looks at the real cost of a (call to) date() - the PHP function that can parse either the current or an inputted timestamp out into the date format you specify.
One of the fringe benefits of open sources an existing code base is that you have an opportunity to setting error_reporting on E_ALL | E_STRICT or perhaps rather just to 2147483647. When you do that you find small problems with your code base you missed the first time you sloppily wrote it. In my case, I noticed that date() was throwing strict errors.
Due to his resulting request to test the error (after submitting a ticket to fix the server's php.ini settings), he went about trying to test and see what the real impact of working with the date function was by developing his own simple benchmarking script. It runs through five different tests some with a default timezone set and some not. His results found that doing it in the script versus on the server's config didn't make much of a difference so he corrected the issue with a quick ini_set (or a date_default_timezone_set).
voice your opinion now!
date timezone default benchmark iniset datedefaulttimezoneset
Joakim Nygard's Blog: Timezones in MySQL and PHP
by Chris Cornutt July 23, 2007 @ 13:43:00
On his blog today, Joakim Nygard has posted about the use (or disuse) of time zones in PHP:
The problem with not handling timezones correctly is not apparent in the usual case of the webserver and the database server being in the same timezone. [...] Often a specific timezone is assumed for displaying date and time. This could very well be incorrect for a large number of visitors. If the database server is in yet another timezone, things begin to get out of sync.
He mentions the time zone functionality that MySQL offers too, but notes that it cannot be relied on either. Thankfully, there's is a bit of hope in PHP5 (as of 5.1 in fact) - the date_default_timezine_set function. He includes an example of the function in use, making it simple to get the correct date and time automatically with the date() function without having to do any hacks to discover the correct time zone.
voice your opinion now!
timezone datedefaulttimezoneset mysql timezone datedefaulttimezoneset mysql
|
Community Events
Don't see your event here? Let us know!
|