PHP Date Problem

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

Trying to ouput a date in the following format

2005-06-30T19:35:14+00:00

Looking at php.net/date this should do it $lastmod = date("c");

But when I echo it out, i get a c lol

Any ideas?
Aaron
 
date('c');

that's if you're trying to output the current date

edit: c is only supported by php5. are you running that on your server? some servers require a different file extension for php5 files...check what yours is :)
 
the only one i don't know, is the T, and that's because i don't know what it refers to...here's what you need:

Code:
date('Y-m-d\T H:i:sO');

that should do it
 
The backslash escapes the T, making it print the literal character rather than the machine's timezone setting.

From the look of it, it appears to be a seperator between the date and the time part of the timestamp.
 
yeah, i know the backslash escapes it...i was trying to print the T because i couldn't see what part it had in the date by looking at the manual or wildly guessing :)
 
Back
Top Bottom