3 ms·
Great advice on going for the lowest (cents) so you can work with integers. I do something similar with dates on all my apps where I go for ints in the database
by chimen 7y ago
Great advice on going for the lowest (cents) so you can work with integers. I do something similar with dates on all my apps where I go for ints in the database and always save unix timestamps. I can't stand dates unless I'm working with timestamps.
- notduncansmith 7y agoSame! Dates are one of the biggest sources of programmer error in my experience, and representing them as ints until they are rendered to a UI prevents a lot of it.
- dchest 7y agoActually, using timestamps for all dates is a bit like using floats for currency. For many cases it doesn't matter, but you lose information.