How do you set a strftime with javascript?
问题 I need to custom format dates. In ruby, I would use strftime, or string formatted time, to accomplish this. now = Time.new now.strftime '%a, %d of %b' #=> "Sat, 27 of Jun" Does javascript use strftime or some equivalent? How can I get a similar effect in javascript? 回答1: UPDATE Arguments of toLocaleString method can also configure the format of the dates. This is supported in modern browser versions, you can see more information here. let date = new Date(Date.UTC(2015, 5, 27, 12, 0, 0)) ,