Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/net/imap/date.rb
Overview
:nodoc:
Constant Summary collapse
- IMAPDATE =
:nodoc:
"%d-%b-%Y"
- IMAPDATETIME =
:nodoc:
"%d-%b-%Y %H:%M %Z"
Class Method Summary collapse
-
.imapdate(str) ⇒ Object
Parse an IMAP date formatted string into a Time.
-
.imapdatetime(str) ⇒ Object
Parse an IMAP datetime formatted string into a Time.
Instance Method Summary collapse
-
#imapdate ⇒ Object
Formats this Time as an IMAP-style date.
-
#imapdatetime ⇒ Object
Formats this Time as an IMAP-style datetime.
-
#yyyy_mm ⇒ Object
Format a date into YYYY-MM, common for mailbox extensions.
Class Method Details
.imapdate(str) ⇒ Object
Parse an IMAP date formatted string into a Time.
10 11 12 |
# File 'lib/net/imap/date.rb', line 10 def self.imapdate str Time.strptime str, IMAPDATE end |
.imapdatetime(str) ⇒ Object
Parse an IMAP datetime formatted string into a Time.
17 18 19 |
# File 'lib/net/imap/date.rb', line 17 def self.imapdatetime str Time.strptime str, IMAPDATETIME end |
Instance Method Details
#imapdate ⇒ Object
Formats this Time as an IMAP-style date.
24 25 26 |
# File 'lib/net/imap/date.rb', line 24 def imapdate strftime IMAPDATE end |
#imapdatetime ⇒ Object
Formats this Time as an IMAP-style datetime.
RFC 2060 doesn’t specify the format of its times. Unfortunately it is almost but not quite RFC 822 compliant. – Go Mr. Leatherpants!
36 37 38 |
# File 'lib/net/imap/date.rb', line 36 def imapdatetime strftime IMAPDATETIME end |
#yyyy_mm ⇒ Object
Format a date into YYYY-MM, common for mailbox extensions.
43 44 45 |
# File 'lib/net/imap/date.rb', line 43 def yyyy_mm strftime("%Y-%m") end |