Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a day of the week for a selected date using PHP? [duplicate]

Tags:

date

php

Possible Duplicate:
How to find day of week in php

I want to get the day of the week of the selected date. For example 05/19/2011 = Thursday

like image 367
jun1989 Avatar asked Dec 12 '22 13:12

jun1989


1 Answers

Here's how to do it for the current time:

$day=strftime("%A",time());

Or for a specific date:

$day=strftime("%A",strtotime("2011-05-19"));
like image 121
AJ. Avatar answered Jan 13 '23 13:01

AJ.