Time search from MYSql database

I save the time in the database with time(), no problem
Time: 1588015705
I take the local time in this format, no problem
echo date_tr(‘j F Y, l, H:i’, ‘1588015705’);
Output: 27 Nisan 2020, Pazartesi, 22:28

I want to search like 27 Nisan…

  $result = $mysqli->query("SELECT * FROM zamanlanmisgorev_gunluk WHERE 
  (calistirma_ciktisi LIKE '%$search%' OR 
  gorev_adi LIKE '%$search%' OR 
  calistirilan_dosya LIKE '%$search%' OR 
  working_time LIKE '%$search%') 
  ORDER BY id ASC LIMIT ".$start_from.", ".$limit);

Can you help me

Thank you from now

If your time is stored in the database as a timestamp, you will need a timestamp to compare it to when querying. To get all results on 27 Nisan 2020:

  1. Get the first second of 27 nissan 2020 as a timestamp.
  2. Get the final second of 27 Nisan 2020 as a timestamp.
  3. SELECT your results where the time is between these two timestamps.

It is necessary to show the date as local time
There is an external php file containing local days and months

For this I keep it with time() working_time varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL
I can change the database format
I am novice, I can not fully understand, can you give an example

Sponsor our Newsletter | Privacy Policy | Terms of Service