Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/26/2021 in all areas

  1. I'm glad this was said, because I was thinking the same thing -- why use an 8 byte integer, when MySQL has smaller date/time datatypes that also support SQL functions natively, with no conversion or clientside logic required? I have written a few blog posts over the years about these topics, that might be of interest: CURDATE and NOW Find Next Monday About MySQL Timestamps
    1 point
  2. I think you'll find that using that number as a unix timestamp is out by a little more than 10 years. It appears to be only 10 years out becouse yo are hard-coding the first 2 digits of the year (why?) $date = date("F d, Y", 20211021141214); echo $date; // October 06, 642431 If you use DateTime class $dt = new DateTime(20211021141214); echo $dt->format('F d, Y H:i:s') // October 21, 2021 14:12:14 Or, if you continue to use date(), convert the string to a valid timestamp $date = date("F d, Y", strtotime('20211021141214')); echo $date . '<br>'; // October 21, 2021
    1 point
  3. What's going on here is that you think "20211021141214" is a number. It is not. It is a string made up of the characters 0-9. That string is not a useful timestamp. Either store your date as a regular DATETIME/TIMESTAMP like "2021-10-21 14:12:14" (easier to work with in SQL) or store it as a Unix timestamp like 1634825534 (easier to work with in PHP).
    1 point
  4. OK - I'm senile. 7 rows in the explain results!!!
    0 points
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.