JavaScript strftime function