Class: StockShaker::DateUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/stock_shaker/date_util.rb

Class Method Summary collapse

Class Method Details

.datetime_to_iso8601(datetime) ⇒ Object

Parse format for Lazada Open Platform



6
7
8
9
# File 'lib/stock_shaker/date_util.rb', line 6

def self.datetime_to_iso8601(datetime)
  time_format = '%Y-%m-%dT%H:%M:%S'
  datetime.strftime(time_format)
end

.datetime_to_timestamp(datetime) ⇒ Object



11
12
13
# File 'lib/stock_shaker/date_util.rb', line 11

def self.datetime_to_timestamp(datetime)
  datetime.to_time.to_i
end