3 ms·
Can you write a one liner to give me the timestamp for start or end of current week, or month? How about a text representation of a difference between two dates
by M4v3R 4y ago
Can you write a one liner to give me the timestamp for start or end of current week, or month? How about a text representation of a difference between two dates? Relative date string (eg. “2 weeks ago”)? Date comparison between two dates that are in different time zones? Does your date calculations take leap hours and leap seconds into account? Date libraries make all these and many more operations a breeze, while rolling these on your own can be tricky, error prone and you’ll be just wasting your time.
- mgkimsal 4y ago> Can you write a one liner to give me the timestamp for start or end of current week, or month? And... it's a multi tenant system, where some organizations use Sunday as the start of a week, and some use Monday. And they all want to be able to switch.