Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Try this:
$my_date = date("Y-m-d H:i:s"); INSERT INTO my_table (date_time) VALUES ('$my_date');
UseIn the date-format parameter of the date function, use : H'H' for 24 hr24hr format h'h' for 12 hr12hr format
Use H for 24 hr format h for 12 hr format
In the date-format parameter of the date function, use : 'H' for 24hr format 'h' for 12hr format
$my_date = date("Y-m-d H:i"i:s"); INSERT INTO my_table (date_time) VALUES ('$my_date');
$my_date = date("Y-m-d H:i"); INSERT INTO my_table (date_time) VALUES ('$my_date')