experiences in software development
Date.parse(Time.now.strftime('%Y/%m/%d'))
ActiveSupport implements Time#to_date. If you're not working on a Rails application, you could always borrow their implementation.
Perfect. Thanks.
No kidding!Date, Time, and File objects in ruby could learn something from the Java core API. Oh well.
Using strftime isn't necessary. You just do:Date.parse(Time.now.to_s)(replace Time.now with your date object!)
Note: Only a member of this blog may post a comment.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
4 comments:
ActiveSupport implements Time#to_date. If you're not working on a Rails application, you could always borrow their implementation.
Reply DeletePerfect. Thanks.
Reply DeleteNo kidding!
Reply DeleteDate, Time, and File objects in ruby could learn something from the Java core API. Oh well.
Using strftime isn't necessary. You just do:
Reply DeleteDate.parse(Time.now.to_s)
(replace Time.now with your date object!)
Note: Only a member of this blog may post a comment.
[フレーム]