JavaScript strptime function