these datetime parse functions are duplicates of the ones in file.rb - this should be refactored out