3 ms·
Do you happen to know the most elegant solution to this problem? Convert the date to seconds since date X (or unix timestamp / 60) and divide by the number of
by umsm 13y ago
Do you happen to know the most elegant solution to this problem?
Convert the date to seconds since date X (or unix timestamp / 60) and divide by the number of mins you need and convert to int.
- pjungwir 13y agoPostgres has `EXTRACT(EPOCH FROM date_col)`, which might not be where you'd think to find that functionality.
- jacques_chester 13y agoNever use raw numbers to represent slices of time, there's just too many corner cases that can throw your calculations off. Use the INTERVAL data type, it handles the logic properly.