我發現格式的指令列表爲strftime方法http://ruby-doc.org/core-2.3.0/Time.html#method-i-strftime 有多種方案來格式化像平日一時間,一個月的一天...但我感興趣的是在格式化像 Time.parse("2016-02-30T12:24").strftime("%XXX, at %H:%M")
# => tomorrow at 12:24
我有一系列datetime64[ns]對象。我想申請strftime('%d-%m-%Y')給他們所有的人,以扭轉年,月,日的順序。我試着使用: series.apply(time.strftime('%d-%m-%Y'))
但我得到的錯誤: TypeError: 'str' object is not callable 任何想法上優雅地做到這一點的正確方法?
我不記得datetime的所有指令,用python代碼或python提示符打印列表的解釋到控制檯的任何方便的方法? https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior Directive | Meaning | Example | Notes
%a | Weekday as loca