astropy/astropy — pull request #1118 by taldcroft (2013-05-22 15:44:45+00:00)
Title: Time conversion utc -> unix missing leap seconds handling

According to http://en.wikipedia.org/wiki/Unix_time
Converting '2004-09-16T23:59:59' UTC into unix time should give :
1095379199.00

But the actual result is :
```python
>>> Time('2004-09-16T23:59:59', scale='utc').unix
1095379223.0
```
Unix time goes backwards one second after the leap second has elapsed.

A script that does work is (although it does not handle fractional seconds afaik):
```python
>>> date = '2004-09-16 23:59:59'
>>> fmt = '%Y-%m-%d %H:%M:%S'
>>> os.environ['TZ'] = 'UTC'
>>> time.tzset()
>>> time.mktime(time.strptime(date, fmt))
1095379199.0
```