function to make timezone aware dates compatible with javascript