Module: PositiveTimeSupport::TimeExt
- Defined in:
- lib/positive_time_support/time_ext.rb
Overview
日付・時刻を扱うクラス Time に機能を追加するモジュール
Instance Method Summary collapse
-
#to_s_hour_and_min ⇒ String
Time のインスタンスを、hh:mm の形の文字列に変換するメソッド.
- #to_strf_normal_en ⇒ Object
- #to_strf_normal_ja ⇒ Object
- #to_time_hm_array ⇒ Object
Instance Method Details
#to_s_hour_and_min ⇒ String
Time のインスタンスを、hh:mm の形の文字列に変換するメソッド
10 11 12 |
# File 'lib/positive_time_support/time_ext.rb', line 10 def to_s_hour_and_min strftime( "%H\:%M" ) end |
#to_strf_normal_en ⇒ Object
20 21 22 |
# File 'lib/positive_time_support/time_ext.rb', line 20 def to_strf_normal_en strftime( "%Y-%m-%d %H:%M:%S %z" ) end |
#to_strf_normal_ja ⇒ Object
14 15 16 17 18 |
# File 'lib/positive_time_support/time_ext.rb', line 14 def to_strf_normal_ja ymd = to_strf_date_ja hms = strftime( "%H:%M:%S" ) "#{ ymd } #{ hms }" end |
#to_time_hm_array ⇒ Object
4 5 6 |
# File 'lib/positive_time_support/time_ext.rb', line 4 def to_time_hm_array [ hour , min ] end |