Re: SELECT NOW() Yields 2018-00-00 0:00:00, NOT Full Date & Time
Thanks for responding. This is what I get:
mysql-sql> SELECT NOW(), CURTIME(), FROM_UNIXTIME(0), UNIX_TIMESTAMP(), FROM_UNIXTIME(UNIX_TIMESTAMP());
+--------------------+-----------+---------------------+------------------+---------------------------------+
| NOW() | CURTIME() | FROM_UNIXTIME(0) | UNIX_TIMESTAMP() | FROM_UNIXTIME(UNIX_TIMESTAMP()) |
+--------------------+-----------+---------------------+------------------+---------------------------------+
| 2018-00-00 0:00:00 | 19:03:28 | 1969-12-31 19:00:00 | 1533337408 | 2018-00-00 0:00:00 |
+--------------------+-----------+---------------------+------------------+---------------------------------+
1 row in set (0.00 sec)
mysql-sql> show variables like '%time%';
+-----------------------------------+-----------------------+
| Variable_name | Value |
+-----------------------------------+-----------------------+
| binlog_max_flush_queue_time | 0 |
| connect_timeout | 10 |
| datetime_format | %Y-%m-%d %H:%i:%s |
| default_password_lifetime | 0 |
| delayed_insert_timeout | 300 |
| explicit_defaults_for_timestamp | OFF |
| flush_time | 0 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_old_blocks_time | 1000 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lc_time_names | en_US |
| lock_wait_timeout | 31536000 |
| log_timestamps | UTC |
| long_query_time | 10.000000 |
| max_execution_time | 0 |
| mysqlx_connect_timeout | 30 |
| mysqlx_idle_worker_thread_timeout | 60 |
| mysqlx_port_open_timeout | 0 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 60 |
| slow_launch_time | 2 |
| system_time_zone | Eastern Daylight Time |
| time_format | %H:%i:%s |
| time_zone | SYSTEM |
| timestamp | 1533337427.613061 |
| wait_timeout | 28800 |
+-----------------------------------+-----------------------+
31 rows in set (0.00 sec)
mysql-sql>
-=> Gregg <=-
Subject
Written By
Posted
Re: SELECT NOW() Yields 2018-00-00 0:00:00, NOT Full Date & Time
August 03, 2018 05:10PM
Sorry, you can't reply to this topic. It has been closed.
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.