Monthly Archives: July 2010

Calculating Relative Time Stamps With PHP and WordPress

If you go to a social networking site like Twitter, you’ll note that status updates don’t have conventional timestamps on them. Instead of something overly informative (in most cases) like “Posted 2010/07/06 7:50 PM” they tend to show the much more human-friendly “Posted 2 days ago” format for recent dates. These relative time stamps are useful in many cases because of how people think about time. If someone tells you that a new book is going to be released on some date. You immediately think “that’s 3 weeks from today.” Relative time stamps take that extra step out.

Now what do you need to do to display relative time stamps? It’s very simple in WordPress, using the human_time_diff() function. Things are a little bit harder for other projects, where you don’t have the luxury of using the pre-existing WordPress functions.

PHP Snippets has a copy-and-paste-able function that works in much the same way. It takes a UNIX timestamp as an input and uses the “granularity” option you set to find the difference between the times, then returns a string.

Firefox 4 Beta 1 Released

The first beta of Firefox 4 is now available (and can be downloaded here). It features plenty of new functionality and web standards support, including hardware-accelerated video and additional support for the evolving CSS3 and HTML5 standards. I’m already impressed by the speed improvements.…

BlogBuzz July 10, 2010

How to Delete GMail Messages in iOS 4

Upon upgrading my iPod Touch to iOS 4, I found one little change that really bothered me. My usual email workflow on my mobile device is to check-off and delete emails that are unimportant (server notifications, newsletters, etc.) and delete them. I would then…

Arq: Back Up Your Mac to Amazon S3

I use some shell scripts to back up my web server to Amazon S3. It’s very cheap and off-site, two things that make for a good backup strategy. But what about personal computers? Most people, myself included, simply back up to external hard disk.…

Firefox 4: The Tabs Will Be on Top

It seems like Firefox 4, when it is finally released, will have its browser tabs above the URL bar. Google Chrome is probably the most known for this practice, though Apple did originally intend to have the same UI change in Safari 4. (Due…

BlogBuzz July 3, 2010

The Safari Challenge

I happened across an interesting post by Chris Coyier recently: The Safari Challenge. Besides being a creative example of the “blogazine” concept, it sums-up an issue that has been bothering me lately. Should I be using Firefox or Safari? I’ve traditionally been a Firefox…