module Aio::Base::Toolkit::Date

Public Class Methods

month_to_i(str) click to toggle source
# File lib/aio/base/toolkit/date.rb, line 4
def month_to_i(str)
        return       case str
                                        when /(?i)Jan/
                                                "01"
                                        when /(?i)Feb/
                                                "02"
                                        when /(?i)Mar/
                                                "03"
                                        when /(?i)Apr/
                                                "04"
                                        when /(?i)May/
                                                "05"
                                        when /(?i)Jun/
                                                "06"
                                        when /(?i)Jul/
                                                "07"
                                        when /(?i)Aug/
                                                "08"
                                        when /(?i)Sep/
                                                "09"
                                        when /(?i)Oct/
                                                "10"
                                        when /(?i)Nov/
                                                "11"
                                        when /(?i)Dec/
                                                "12"
                                        else
                                                "unknow"
                                        end
end
time_to_s(arr) click to toggle source

arr = [time, zone, week, year, month, day]

# File lib/aio/base/toolkit/date.rb, line 36
def time_to_s(arr)
        year         = arr[3]
        month = arr[4]
        day  = arr[5]
        time         = arr[0]
        format("%s-%s-%s %s", year, month, day, time)
end