Welcome Guest, Not a member yet? Register   Sign In
Convert a date, which is stored in a mysql database [SOLVED]
#7

[eluser]testietest[/eluser]
[quote author="Phil Sturgeon" date="1257958564"]No digging required.

Code:
$datetime = new DateTime($r->date);
echo $datetime->format('jS, F Y');

If you are feeling REALLY lazy...

Code:
<?php echo date('jS, F Y', strtotime($r->date));?>

I would go with DateTime though, much more useful.[/quote]

Hi Phil,

Extremely kind of you to give me these solutions. Exactly what I was looking for. Thank you a lot! Final code became
Code:
<?php echo date('d-m-Y', strtotime($r->date));?>
because I like all numbers better.

With kind regards,

Wesley


Messages In This Thread
Convert a date, which is stored in a mysql database [SOLVED] - by El Forum - 11-11-2009, 05:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB