Displaying date field from recordset in dd-mm-yyyy format
We're pulling a date field from our recordset but when it's displayed on the page:
<?php echo($rsEDITPROD->getColumnVal("wbprodDATEDISTILLED")); ?> ...it displays as yyyy-mm-dd.
I've had several goes at resolving it but my PHP knowledge scuppers me yet again:
<?php echo(date_format($rsEDITPROD->getColumnVal("wbprodDATEDISTILLED"),"d-m-Y")); ?>
<?php $date=date_create($rsEDITPROD->getColumnVal("wbprodDATEDISTILLED")); echo date_format($date,"d-m-Y"); ?>
The last one of these works, however when there is no date value for this field it defaults to today's date! :(
Thanks for any advice offered. I will get there eventually...
NJ