4 ms·
What timestamp types are available in MySQL, SQL Server, and Oracle?
by cpeterso 8y ago
What timestamp types are available in MySQL, SQL Server, and Oracle?
- tyingq 8y agoBe careful with the MySQL ones. A couple of them overflow past 1-1-2038, which would break some use cases now. https://bugs.mysql.com/bug.php?id=12654 https://bugs.mysql.com/bug.php?id=12654
- deleted 8y ago[deleted]
- emmelaich 8y agoDunno but sqlite3 assumes times are in utc.
- userbinator 8y agoSQL Server has datetimeoffset, which computes in UTC but also stores the timezone.
- niftich 8y agoOracle has 'DATE', 'TIMESTAMP', 'TIMESTAMP WITH TIME ZONE', and 'TIMESTAMP WITH LOCAL TIME ZONE'. Out of these, 'TIMESTAMP' and 'TIMESTAMP WITH TIME ZONE' do exactly what you'd expect without needing a big tutorial. 'DATE' is a 'TIMESTAMP' that can't store fractional seconds. And 'TIMESTAMP WITH LOCAL TIMEZONE' is an unmitigated footgun that you'll probably misuse.