module Fora

Constants

C
VERSION

Protected Instance Methods

date_format(date) click to toggle source
# File lib/fora.rb, line 13
def date_format(date)
  date.strftime("%m/%d/%Y")
end
parse_us_date(date) click to toggle source
# File lib/fora.rb, line 25
def parse_us_date(date)
  Date.strptime(date, "%m/%d/%Y")
end
parse_us_time(time, zone = "UTC") click to toggle source
# File lib/fora.rb, line 33
def parse_us_time(time, zone = "UTC")
  opts = "%m-%d-%Y %H:%M %Z"
  t = [time, zone].join(" ")
  if zone == "UTC"
    DateTime.strptime(t, opts).to_time.utc # perfer time object return
  else
    DateTime.strptime(t, opts).to_time.local_time
  end
end
time_format(time) click to toggle source
# File lib/fora.rb, line 18
def time_format(time)
  time.strftime("%m-%d-%Y %H:%M")
end