MySQL Forums
Forum List  »  Newbie

SELECT NOW() Yields 2018-00-00 0:00:00, NOT Full Date & Time
Posted by: Gregg Leichtman
Date: August 02, 2018 08:07AM

I have installed MySQL 5.7.21 on Windows 10 as shown:
mysql-sql> show variables like '%innodb_version%';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| innodb_version | 5.7.21 |
+----------------+--------+

When I run select on now(), I get:
mysql-sql> select now();
+--------------------+
| now() |
+--------------------+
| 2018-00-00 0:00:00 |
+--------------------+

When I run a select on date of now(), I get:
mysql-sql> select date(now());
+-------------+
| date(now()) |
+-------------+
| 2018-08-02 |
+-------------+

When I run a select on time of now(), I get:
mysql-sql> select time(now());
+-------------+
| time(now()) |
+-------------+
| 09:58:56 |
+-------------+

I don't ever get the full date or time no matter when I run the select now().

Not surprisingly this happens in the MySQL shell and the workbench.

What magical incantation am I missing here?

-=> Gregg <=-

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.