Display day of the week, according to the date used in the PHP query

0

Good afternoon everyone, I have a question in a course project. I have a form where I look for patients scheduled on a particular day of the month.

When I perform the query to present the scheduled patients, I must also present the day of the week, that day of the month used in the select. The date format is in the "day / month / year" pattern.

How could I do this?

    
asked by anonymous 20.12.2017 / 19:05

1 answer

3

You can use the following PHP function:

string date ( string $format [, int $timestamp ] );

It looks like this:

echo date("D", strtotime("20/12/2017"));

There are other formats like:

$today = date("F j, Y, g:i a");                 // March 10, 2001, 5:16 pm
$today = date("m.d.y");                         // 03.10.01
$today = date("j, n, Y");                       // 10, 3, 2001
$today = date("Ymd");                           // 20010310
$today = date('h-i-s, j-m-y, it is w Day');     // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today = date('\i\t \i\s \t\h\e jS \d\a\y.');   // it is the 10th day.

References: date () function, strtotime () function.

    
20.12.2017 / 19:14