mktime value database
I run a charitable site that allows users to create their own site in one of several languages, I'm trying to get the date to display in the language of the specific site, rather than just using English dates.
I've **almost** got there, but the database values aren't being returned using the following code - hopefully someone can sort me out!
The test query is:
$query_rsTest = "SELECT pages.PgID, pages.PgTitle, DATE_FORMAT(pages.EvStDate, '0, 0, 0, %c, %e, %Y')AS EvStDate FROM pages WHERE pages.EvStDate <>'' limit 5";
which appears to return the dates in the rquired format, eg 0, 0, 0, 9, 17, 2014
This bit of code I found elsewhere works fine:
<?php
setlocale(LC_TIME, 'fr_FR.UTF8');
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 8, 22, 2014));
?>
returning the date in French.
However, when I try to use this example with database values, it defaults to today's date:
<?php do { ?>
<p>Tests: <?php
setlocale(LC_TIME, 'fr_FR.UTF8');
echo strftime("%a %e %b %Y", mktime($row_rsTest['EvStDate']));
?></p>
<?php } while ($row_rsTest = mysql_fetch_assoc($rsTest)); ?>
I'm guessing that some additonal code is needed around $row_rsTest['EvStDate'] - but I'm clutching at straws!
Any help much appreciated
Thanks
Chris