Module: PositiveTimeSupport::TimeExt

Defined in:
lib/positive_time_support/time_ext.rb

Overview

日付・時刻を扱うクラス Time に機能を追加するモジュール

Instance Method Summary collapse

Instance Method Details

#to_s_hour_and_minString

Time のインスタンスを、hh:mm の形の文字列に変換するメソッド

Returns:

  • (String)


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_enObject



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_jaObject



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_arrayObject



4
5
6
# File 'lib/positive_time_support/time_ext.rb', line 4

def to_time_hm_array
  [ hour , min ]
end