title: Pseudo-code algorithm to calculate the Unix epoch timestamp from given date and time?
body: <p>Given UTC date and time as <code>year</code>, <code>month</code>, <code>day</code>, <code>hour</code>, <code>minute</code>, <code>second</code>, I was wondering about a pseudo-code algorithm to calculate the corresponding Unix epoch timestamp.</p>
  <p>There are 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day. So we can just use 60 × 60 × 24 = 86400 seconds per day and count the days backwards until 1970-01-01T00:00:00Z, right? Months have different numbers of days, though. So it's probably better to skip that and use 365 days per year. But then, there's leap years... and leap seconds... and more?</p>
  <p>Does that suddenly make the algorithm as complex as dealing with <a href="https://www.youtube.com/watch?v=-5wpm-gesOY" rel="nofollow noreferrer">timezones</a> or is it still fairly easy to describe?</p>