date-diff

The difference in months between dates in MySQL

I'm looking to calculate the number of months between 2 date time fields. Is there a better way than getting the unix timestamp and the dividing by 2 592 000 (seconds) and rounding up whithin MySQL? ...

Calculate working hours between 2 dates in Postgresql

I am developing an algorithm with Postgres (PL/PgSQL), and I need to calculate the number of working hours between 2 dates, taking into account that weekends are not working and the rest of the days are counted only from 8am to 15pm. Examples: From Dec 3rd at 14pm to Dec 4th at 9am should count 2 hours. (3rd = 1, 4th = 1) From Dec 3rd...