You are here

date-math

PostgreSQL: "UNIX Time" To Date

In some effort to avoid time-zone drama, or perhaps due to fantasies of efficiency, some developer put a date-time field in a PostgreSQL database as an integer; specifically as a UNIX Time value. ¯\_(ツ)_/¯

How to present this as a normal date in a query result?

Counting weekdays between dates

Need a method to accurately count the number of weekdays between two days? [The key here is "accurately", it is a bit harder than it seems at first]. In Python there are several ways to do this, but most involve some iteration or list comprehension. In my opinion, if you have to do that, you are probably violating the Python idiom of "use the batteries".

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer