Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby18/lib64/ruby/1.8
File: parsedate.rb
#
[0] Fix | Delete
# = parsedate.rb: Parses dates
[1] Fix | Delete
#
[2] Fix | Delete
# Author:: Tadayoshi Funaba
[3] Fix | Delete
# Documentation:: Konrad Meyer
[4] Fix | Delete
#
[5] Fix | Delete
# ParseDate munches on a date and turns it into an array of values.
[6] Fix | Delete
#
[7] Fix | Delete
[8] Fix | Delete
#
[9] Fix | Delete
# ParseDate converts a date into an array of values.
[10] Fix | Delete
# For example:
[11] Fix | Delete
#
[12] Fix | Delete
# require 'parsedate'
[13] Fix | Delete
#
[14] Fix | Delete
# ParseDate.parsedate "Tuesday, July 6th, 2007, 18:35:20 UTC"
[15] Fix | Delete
# # => [2007, 7, 6, 18, 35, 20, "UTC", 2]
[16] Fix | Delete
#
[17] Fix | Delete
# The order is of the form [year, month, day of month, hour, minute, second,
[18] Fix | Delete
# timezone, day of the week].
[19] Fix | Delete
[20] Fix | Delete
require 'date/format'
[21] Fix | Delete
[22] Fix | Delete
module ParseDate
[23] Fix | Delete
#
[24] Fix | Delete
# Parse a string representation of a date into values.
[25] Fix | Delete
# For example:
[26] Fix | Delete
#
[27] Fix | Delete
# require 'parsedate'
[28] Fix | Delete
#
[29] Fix | Delete
# ParseDate.parsedate "Tuesday, July 5th, 2007, 18:35:20 UTC"
[30] Fix | Delete
# # => [2007, 7, 5, 18, 35, 20, "UTC", 2]
[31] Fix | Delete
#
[32] Fix | Delete
# The order is of the form [year, month, day of month, hour, minute,
[33] Fix | Delete
# second, timezone, day of week].
[34] Fix | Delete
#
[35] Fix | Delete
# ParseDate.parsedate can also take a second argument, +comp+, which
[36] Fix | Delete
# is a boolean telling the method to compensate for dates with years
[37] Fix | Delete
# expressed as two digits. Example:
[38] Fix | Delete
#
[39] Fix | Delete
# require 'parsedate'
[40] Fix | Delete
#
[41] Fix | Delete
# ParseDate.parsedate "Mon Dec 25 00 06:53:24 UTC", true
[42] Fix | Delete
# # => [2000, 12, 25, 6, 53, 24, "UTC", 1]
[43] Fix | Delete
#
[44] Fix | Delete
def parsedate(str, comp=false)
[45] Fix | Delete
Date._parse(str, comp).
[46] Fix | Delete
values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :wday)
[47] Fix | Delete
end
[48] Fix | Delete
[49] Fix | Delete
module_function :parsedate
[50] Fix | Delete
[51] Fix | Delete
end
[52] Fix | Delete
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function