Utility to convert timestamps in different formats