Skip to content

Commit d2200fc

Browse files
authored
Update README.md
1 parent 82ba554 commit d2200fc

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,24 @@ java -jar pg2sqlite-1.0.3.jar -d database.dump -o sqlite.db
3030

3131
`pg2sqlite -d <file> -o <file> [-f <true|false>]`
3232

33-
* `-d <file>` - file that contains dump of postgresql database (made by pg_dump, accepts .gz)
34-
* `-o <file>` - file name of newly created sqlite3 database
35-
* `-f <true|false>` - default: false, force database re-creation if database file alredy exists
33+
* `**-d** <file>` - file that contains dump of postgresql database (made by pg_dump, accepts .gz)
34+
* `**-o** <file>` - file name of newly created sqlite3 database
35+
* `**-f** <true|false>` - default: false, force database re-creation if database file alredy exists
36+
* `**-t** <integer|text|real>` - default: integer, change sqlite3 date class (read below)
37+
38+
## Timestamps
39+
40+
SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in [Date And Time Functions](https://www.sqlite.org/lang_datefunc.html) of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:
41+
42+
* TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").
43+
* REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
44+
* INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.
45+
46+
By default pg2sqlite uses **INTEGER** to store dates, but you can change this with **-t** argument (`-t text` or `-t real`), use it like this:
47+
48+
```sh
49+
java -jar pg2sqlite-1.0.3.jar -d database.dump -o sqlite.db -t text
50+
```
3651

3752
## Tips
3853

0 commit comments

Comments
 (0)