fun with dates/times in php

I just spent far too long looking for an old comment in the old boaddrink.com forums. (don't you hate it when you remember saying something, but can't remember what it was exactly?)

While I didn't find what I was looking for, I did come across this old tip about working with dates in PHP. It's ripped from an example in the php.net docs, so I'm sure everyone's seen it by now, but I still think it's worth having around as a reminder (so hopefully I won't have to spend 20 minutes looking for it if I ever remember this post, but not what it contained :)

example 1
$tomorrow = mktime(0,0,0, date("m") ,date("d") + 1, date("Y"));
example 2
echo(date('l, F j, Y g:i:s a', mktime(date('H') + 1)));
should give you your server's time + 1 hour.

By desolate on

Stalk me!

Drupal Association Member