3 ms·
I prefer the use of Unix timestamps. Easier to filter with standard Unix tools, and if I really need formatted date+time in my output, I can always use awk.
by 10000truths 5y ago
I prefer the use of Unix timestamps. Easier to filter with standard Unix tools, and if I really need formatted date+time in my output, I can always use awk.
- simion314 5y agoI don like it, say I open a database table and search for some events , then look at the created_at column and see a timestamp, so now I need to copy paste timestamps into a webpage and convert it to human readable time to then notice is 5 years old and not what i am looking for. What are you doing in this case?(in case you worked with database logs), export to csv and then do it with unix tools?
- 8n4vidtmkvmk 5y agodepending on the sql dialect, you can convert it in sql. or even add a virtual column with the conversion for your convenience
- berkes 5y agoI used to prefer unix timestamps too. But I Saw The Light. For one: those standard Unix tools can convert from date/time values to timestamps just as easy. Arguably easier. And a timestamp is merely an Int, so many languages, databases, APIs and so on, lack ergonomic methods to convert timestamps to datetimes. But have easy ways to do the reverse. It's almost always easier to convert dates, times or datetimes to timestamp ints (or floats) than to convert an int or float to a date, datetime or time. A timestamp.toString() is unfamiliar to humans, a datetime.toString() is not. The list of small benefits in favor of actual date or time types just goes on.