Jump to content

echo "time=" . time(); But Format to: Tue Mar 1 23:50:00 GMT-0300 2011 EXAMPLE


nightkarnation

Recommended Posts

Hey Guys!

I have the following doubt.

 

When echoing from Server like this:

 

echo "time=" . time();

 

I get the time in the following raw format: 1299272294

 

I would really like to echo it with this format: Tue Mar 1 23:50:00 GMT-0300 2011

 

Is there a way I could do that?

 

Really looking forward for some help on this one,

 

Thanks a lot in advance!

Cheers!

Link to comment
Share on other sites

First of all, Thanks a lot guys for the help!

 

Jcbones, that line of code is 95% correct to what I need, theres only one slight change, I am echoing the following:

 

Fri Mar 4 18:10:25 e-0300 2011

 

and it should be:

 

Fri Mar 4 18:10:25 GMT-0300 2011

 

Any ideas and/or suggestions?

 

Thanks again!

Cheers!

Link to comment
Share on other sites

What version of PHP are you using?

 

e Timezone identifier (added in PHP 5.1.0) Examples: UTC, GMT, Atlantic/Azores

 

You could just write the GMT in there, it would have to be escaped though.

echo 'time=' . date('D M j H:i:s \G\M\TO Y');

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.