Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/leap_salesforce/ext/time.rb
Overview
adding additional methods to inbuit time object
Class Method Summary collapse
-
.parse_salesforce(date_string) ⇒ Time
Time object created from salesforce date String.
Instance Method Summary collapse
-
#salesforce_format ⇒ String
String represents time in salesforce format.
Class Method Details
.parse_salesforce(date_string) ⇒ Time
Returns Time object created from salesforce date String.
12 13 14 |
# File 'lib/leap_salesforce/ext/time.rb', line 12 def self.parse_salesforce(date_string) mktime(*date_string.split('-')) end |
Instance Method Details
#salesforce_format ⇒ String
Returns String represents time in salesforce format.
6 7 8 |
# File 'lib/leap_salesforce/ext/time.rb', line 6 def salesforce_format strftime('%Y-%m-%d') end |