-
-
Save jonleighton/9cff3986c396eecf6374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mysql -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 53 | |
Server version: 5.5.14 MySQL Community Server (GPL) | |
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. | |
Oracle is a registered trademark of Oracle Corporation and/or its | |
affiliates. Other names may be trademarks of their respective | |
owners. | |
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. | |
mysql> use test; | |
Reading table information for completion of table and column names | |
You can turn off this feature to get a quicker startup with -A | |
Database changed | |
mysql> create table fuu (time datetime); | |
Query OK, 0 rows affected (0.02 sec) | |
mysql> describe fuu; | |
+-------+----------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-------+----------+------+-----+---------+-------+ | |
| time | datetime | YES | | NULL | | | |
+-------+----------+------+-----+---------+-------+ | |
1 row in set (0.00 sec) | |
mysql> insert into fuu VALUES ("2009-07-11 20:00:00"); | |
Query OK, 1 row affected (0.01 sec) | |
mysql> insert into fuu VALUES ("2009-07-11 20:00:00 +0100"); | |
Query OK, 1 row affected, 1 warning (0.01 sec) | |
mysql> insert into fuu VALUES ("2009-07-11T20:00:00+0100"); | |
Query OK, 1 row affected, 1 warning (0.01 sec) | |
mysql> SELECT * FROM fuu; | |
+---------------------+ | |
| time | | |
+---------------------+ | |
| 2009-07-11 20:00:00 | | |
| 2009-07-11 20:00:00 | | |
| 2009-07-11 20:00:00 | | |
+---------------------+ | |
3 rows in set (0.00 sec) | |
mysql> quit | |
Bye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ psql test | |
psql (9.0.4) | |
Type "help" for help. | |
test=# create table fuu (time timestamp); | |
CREATE TABLE | |
test=# \d fuu | |
Table "public.fuu" | |
Column | Type | Modifiers | |
--------+-----------------------------+----------- | |
time | timestamp without time zone | | |
test=# insert into fuu values ('2009-07-11 20:00'); | |
INSERT 0 1 | |
test=# insert into fuu values ('2009-07-11 20:00 +0100'); | |
INSERT 0 1 | |
test=# insert into fuu values ('2009-07-11T20:00+0100'); | |
INSERT 0 1 | |
test=# select * from fuu; | |
time | |
--------------------- | |
2009-07-11 20:00:00 | |
2009-07-11 20:00:00 | |
2009-07-11 20:00:00 | |
(3 rows) | |
test=# \q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sqlite3 /tmp/test.db | |
SQLite version 3.7.5 | |
Enter ".help" for instructions | |
Enter SQL statements terminated with a ";" | |
sqlite> create table fuu (time timestamp); | |
sqlite> .schema fuu | |
CREATE TABLE fuu (time timestamp); | |
sqlite> insert into fuu values ('2009-07-11 20:00'); | |
sqlite> insert into fuu values ('2009-07-11 20:00 +0100'); | |
sqlite> insert into fuu values ('2009-07-11T20:00+0100'); | |
sqlite> select * from fuu; | |
2009-07-11 20:00 | |
2009-07-11 20:00 +0100 | |
2009-07-11T20:00+0100 | |
sqlite> select datetime(time) from fuu; | |
2009-07-11 20:00:00 | |
sqlite> .quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment