Toni Michel Caubet
Toni Michel Caubet

Reputation: 20163

Convert yyyy-mm-dd hh:mm:ss to dayoftheweek, dd of monthname yyyy

I almost have this by

$this->fecha = '2013 05-05 05:55:05'
$yearvalue = date("Y", strtotime($this->fecha) );
$monthname = date("F", strtotime($this->fecha) );
$dayvalue = date("d", strtotime($this->fecha) );
$printFecha = "$dayvalue of $monthname $yearvalue";

Which outputs 5 of May 2013

How can I get the name of the day of the week?

Upvotes: 0

Views: 424

Answers (2)

Ares
Ares

Reputation: 5903

You can do it like this,

echo date('l j \of F Y', $this->date);

Your output will be something like this

Sunday 5 of May 2013

Upvotes: 1

Andrew
Andrew

Reputation: 7778

Using date of 2005-05-12:

echo date("l", mktime(0, 0, 0, 5, 12, 2005)); 

you'd get 'Thursday'.

Upvotes: 1

Related Questions