CodeIgniter Forums
rss date format - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: rss date format (/showthread.php?tid=20780)



rss date format - El Forum - 07-21-2009

[eluser]benfike[/eluser]
Hi!

I have an problem, here is the date code.
Code:
<?php echo date($post['maindate']) ?>


But when i view all date good, but hours and minutes all the time: 2:00? why?

help please

I wanna YEAR-MONATH-DAY HOUR:MINUTES format


rss date format - El Forum - 07-24-2009

[eluser]xzela[/eluser]
hi,

try:
Code:
echo date('Y-m-d h:i', $post['maindate']);

also, try reading this documentation:
http://www.php.net/manual/en/function.date.php


rss date format - El Forum - 07-24-2009

[eluser]dmorin[/eluser]
that will only work if $post['maindate'] is a unix timestamp. Try:

Code:
echo date('Y-m-d H:i', strtotime($post['maindate']));



rss date format - El Forum - 07-24-2009

[eluser]xzela[/eluser]
yes, dmorin is correct, that would work perfectly.


rss date format - El Forum - 07-25-2009

[eluser]benfike[/eluser]
I change code to this dmorin, but doesn't work.. Again 02:00 all time!:S

you can see RSS: http://arsenalfan.hu/rss


rss date format - El Forum - 07-25-2009

[eluser]xzela[/eluser]
your pubdate looks fine to me:
Code:
<pubDate>2009-07-25 17:26</pubDate>

isn't that what you wanted?


rss date format - El Forum - 07-25-2009

[eluser]benfike[/eluser]
yes in the source this is good, but in view this shit Big Grin