Friday 31 July 2020

PHP: How to get todays date in ISO format compatible with MySQL [answered]

PHP: How to get todays date in ISO format compatible with MySQL [answered]


I often write reports that use date format for selection and need to query a database. I use PHP, so here's the way I get dates.

$dateToday date("Y-m-d");   // 2020-07-31 (iso format can be used in MySQL)

$dateTimeNow date("Y-m-d H:i:s"); // 2020-07-31 08:35:18 (the MySQL DATETIME format)  

I hope this is useful to you.
If you found it useful, perhaps have a listen to my music at Projektor Digital https://app.projektordigital.com/player/index.php?playlist=39&uid=7

1 comment:


  1. I AM GREAT DR AIZONOFE OF ESAN LAND, SPECIALIZE ON ANY SPIRITUAL PROBLEM,AND HERBS TREATMENT,AS FELLOWS

    1 Powerful spell to get back ex lover
    2 Penis enlargement
    3 Lower sperm count
    4 Genital herpes
    4 Herbs for Thyroid Hashimotos.
    5 Money spell
    6 court case spell
    7 And any different types of problem you are into.
    You can also contact me via Email (draizonofeherb@gmail.com)or via WHATSAPP (+2348136785562) MY TREATMENT ARE 100 PERCENT GUARANTEE WITH NO SIDE EFFECT, FOCUS ON SOLUTION NOT YOUR PROBLEM,

    ReplyDelete