JGeer
JGeer

Reputation: 1852

Php change time format

I want to change the time format using php but I can not get it right. The loaded value (delivery_eta) got the time format Ymd, so for example 20180925.

But I want to change that to Tuesday 25 September 2018.

My current code:

<?php $locale = 'nl_NL'; $date = new Zend_Date($_product->getData('delivery_eta'),'Ymd'); $date->setLocale($locale);echo $date->toString(Zend_Date::DATE_FULL);?> 

No the output is:

Sunday 9 January 20

What am I missing?

Upvotes: 0

Views: 53

Answers (1)

Ibrahim Wehbi
Ibrahim Wehbi

Reputation: 675

$date = date("l d Y", $_product->getData('delivery_eta'));

Upvotes: 1

Related Questions