Host with MediaTemple? Here's a workaround for PHP Date Constants

Monday, January 4, 2010 , Posted by Johnny Fuery at 1:37 AM

Originally Published 2007-12-21 16:53:54

I ran into an issue with my dedicated MediaTemple (not an affiliate link) server today.

This works on my local WAMP development server:

$timestamp = date(DATE_RFC822);

It doesn't when I post the same code to my dedicated virtual server at MediaTemple.  Looks like their date constants are all disabled, and I don't have time to wait around for support. So, here's the workaround:

// Manual translation into RFC822 format, e.g. "Mon, 15 Aug 2005 15:52:01 UTC"
$timestamp    = gmdate("D, d F Y H:i:s");
$timestamp .= " UTC";

Enjoy.

Currently have 0 comments:

Leave a Reply

Post a Comment