tags:

views:

65

answers:

2

This is confusing as hell, here's the php I'm using:

<?php echo date('H:i D j, F',$j->date); ?>

This is what it gives me:

01:33 Thu 1, January

Which seems fine, until you look at the actual time that is being given ($j->date provides):

2010-06-12 21:12:23

Why is it giving me a January and what am I doing wrong?

+7  A: 

$j->date must provide date() with a standard unix timestamp. take a look at the manual. You might want to pass it through the strtotime() function first.

<?php echo date('H:i D j, F', strtotime($j->date)); ?>

$j->date output must be a US English date format.

Sepehr Lajevardi
epic rtfm moment. Thank you very much dude.
Kirill
lol, you're welcome ;)
Sepehr Lajevardi
+2  A: 

Try this:

<?php echo date('H:i D j, F', strtotime($j->date)); ?>

The date() function only takes a timestamp, not a time string which you are trying to provide it. The strtotime() function will convert it for you before sending it to date().

animuson
thank you, I think the guy above you stole your answer after you put it in :) accepting his.
Kirill