Issue 1:
I'm using pandas version '0.7.0rc1' with Python 2.7.2 on Windows XP.

When writing HDF files, pandas tries to convert datetime index values to an ordinal using time.mktime. mktime does not support any dates before 1969.

error output shows the offending line to be:

File "C:\Python27\lib\site-packages\pandas\io\pytables.py", line 697, in _convert_index

converted = np.array([time.mktime(v.timetuple()) for v in values],

I suggest datetime.toordinal() instead of time.mktime(). However, doing so break existing HDF files.

test program to demonstrate the problem

import pandas
import numpy

newIndex = pandas.DateRange('1/1/2000', periods=8)

newDF = pandas.DataFrame(numpy.random.randn(8, 3), index=newIndex,
columns=['A', 'B', 'C'])

oldIndex = pandas.DateRange('1/1/1950', periods=8)

oldDF = pandas.DataFrame(numpy.random.randn(8, 3), index=oldIndex,
columns=['A', 'B', 'C'])

store = pandas.io.pytables.HDFStore('store.h5')
print '--- writing new ---'
store['newDF'] = newDF

print '--- writing old ---'
store['oldDF'] = oldDF

print 'done'

Issue 2:
I am having trouble with pre-epoch dates working with HDFStore, getting an OverflowError in mktime, as shown below.

Sample code is:

import numpy as np
from pandas import *

def panda_test():

# generate some data
data = np.random.rand(50,5)
# generate some dates
dates = DateRange('1/1/1969',periods=50)
# generate column headings
cols = ['A','B','C','D','E']

df = DataFrame(data,index=dates,columns=cols)

# save to HDF5Store
store = HDFStore('bugzilla.h5', mode='w')
store['df'] = df # This gives: OverflowError: mktime argument out of range
store.close()

if __name__ == '__main__':
panda_test()

The error I get is:

Traceback (most recent call last):
File "C:\Users\Salman Ansari\Documents\Python\VAR\src\bugzilla.py", line 27, in <module>
panda_test()
File "C:\Users\Salman Ansari\Documents\Python\VAR\src\bugzilla.py", line 22, in panda_test
store['df'] = df
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 122, in __setitem__
self.put(key, value)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 260, in put
comp=compression)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 327, in _write_to_group
wrapper(value)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 325, in <lambda>
wrapper = lambda value: handler(group, value)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 335, in _write_frame
self._write_block_manager(group, df._data)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 346, in _write_block_manager
self._write_index(group, 'axis%d' % i, ax)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 432, in _write_index
converted, kind, _ = _convert_index(index)
File "C:\Python27\lib\site-packages\pandas-0.4.0-py2.7-win32.egg\pandas\io\pytables.py", line 698, in _convert_index
for v in values], dtype=np.int64)
OverflowError: mktime argument out of range
Closing remaining open files: bugzilla.h5... done

Any ideas, please?