Dates, Times and Timezones - How are they incorporated in Interval? Does interval '1 month' incorporate month differences and leap years when calculating date/datetime boundaries?  If so, how does it work?


I was asked this question, and I'm not sure how to answer it.  I am using Postgres as a reference example, I assume it has its own time offset and calculation integration.  But how does this take into account timezones, leap years, and other oddities of the calendaring?

I want to know if there's anything in a the SQL spec that defines how the behavior will occur.
Yes, if not it would cause all kinds of errors.  when doing math on a date for example 1 month ago, it does take the date to be subtract from and figures out what to do from there,  it does not just subtract 30 days. 

links will answer your question
wiki interval
another site

also consider this simple query

select '03-01-2019'::date - interval '30 day',
'03-01-2019'::date -interval '1 month'