example:
$date = ‘Wed, 18 Feb 2009 16:03:52 GMT’;
//How can I get $date to equal the current time in the same format?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you mean how to get similar format as that? As there is no exact match in the predefined date constants, this would do it:
That would return the current date and time in the same format as ‘Wed, 18 Feb 2009 16:03:52 GMT’.
EDIT
GMT and UTC are (in normal cases) completely interchangeable, and as gmdate always returns an GMT/UTC date, you can just use this:
Or, as it turns out, you can replace e with T to get GMT: