Class: PayPal::SDK::Core::API::DataTypes::SimpleTypes::DateTime

Inherits:
DateTime
  • Object
show all
Defined in:
lib/paypal-sdk/core/api/data_types/simple_types.rb

Class Method Summary collapse

Class Method Details

.new(date_time) ⇒ Object


43
44
45
46
# File 'lib/paypal-sdk/core/api/data_types/simple_types.rb', line 43

def self.new(date_time)
  date_time = "0001-01-01T00:00:00" if date_time.to_s == "0"
  date_time.is_a?(::DateTime) ? date_time : parse(date_time.to_s)
end