Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the MySQL datetime format work with SQLite and PostgreSQL?

In MySQL you enter dates (datetime field) in the format 2009-10-16 21:30:45. Which makes it simple to insert times into the database.

$date = date('Y-m-d H:i:s', $timestamp);

Will this format work with SQLite and PostgreSQL? If not, what format do they use?

like image 656
Xeoncross Avatar asked Jul 10 '26 05:07

Xeoncross


2 Answers

SQLite uses several date formats; PostgreSQL uses similar formats and more.

Both understand YYYY-MM-DD HH:MM:SS.

Yes for Postgres.

like image 31
Milen A. Radev Avatar answered Jul 11 '26 20:07

Milen A. Radev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!