{"id":31,"date":"2021-01-12T08:54:42","date_gmt":"2021-01-12T08:54:42","guid":{"rendered":"https:\/\/veltzer.net:8890\/?p=31"},"modified":"2021-01-12T08:54:42","modified_gmt":"2021-01-12T08:54:42","slug":"producing-mysql-dates-on-the-command-line","status":"publish","type":"post","link":"https:\/\/veltzer.net:8890\/producing-mysql-dates-on-the-command-line\/","title":{"rendered":"Producing MySQL dates on the command line"},"content":{"rendered":"\n

I often find myself in need of inserting data manually into a MySQL database using some kind of database editor. In a database editor you find yourself manually inserting values into cells of a table and in most of them you are not allowed to enter an SQL expression (the MySQL Query Browser is a prime example). In this case I need some way to generate the current date and time as per the MySQL format quickly on the command line. I will usually use:<\/p>\n\n\n\n

alias date_mysql=\"date +'%F %T'\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

I often find myself in need of inserting data manually into a MySQL database using some kind of database editor. In a database editor you find yourself manually inserting values into cells of a table and in most of them you are not allowed to enter an SQL expression (the MySQL Query Browser is a … <\/p>\n