in reply to high speed/efficiency http date to unix time, leap years handling?

I spot (($year)%4). That's incomplete. Every year divisible by 4 is a leap except those divisible by 100. But those divisible by 400 are also leap years.

2095 n 2096 y 2097 n 2098 n 2099 n 2100 n <-- %100==0 2101 n 2102 n 2103 n 2104 y 2105 n 1995 n 1996 y 1997 n 1998 n 1999 n 2000 y <-- %400==0 2001 n

But since you're restricting yourself to the years 1970 to 2038, you're ok.

You've basically reimplemented (core module) Time::Local's timegm_nocheck, so you might want to verify against it.