-7

$date = date('Y-m-d h:i');

I have been using this function for recording date in my tables. Previosuly i use to create date using wrong function like mktime.

  • 1
    This is not how you ask questions. Don't assume that an image of a web page makes our crystal ball fire up and enlighten us on what your code is. – trincot Aug 27 '17 at 08:35
  • what kind of info you need,bcoz i am learning it and unable to understand it how should i convert my this date into displaying which day it was. This image is for understanding... so here you can understand... – kunal chauhan Aug 27 '17 at 08:42
  • 2
    Possible duplicate of [Retrieving Day Names in PHP](https://stackoverflow.com/questions/7765469/retrieving-day-names-in-php) – Maverick Aug 27 '17 at 08:53

1 Answers1

1

Easy one:

$today = date('l'); // returns Sunday 

When you want it to do like your image, you should get your date from the dropdown. Then do the following:

$date = '2017-7-27 10:51:10'; // example date 

var_dump(date('l', strtotime($date))); // returns Sunday

Goodluck!

Sander bakker
  • 518
  • 1
  • 6
  • 20