class StockShaker::DateUtil

Public Class Methods

datetime_to_iso8601(datetime) click to toggle source

Parse format for Lazada Open Platform

# 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) click to toggle source
# File lib/stock_shaker/date_util.rb, line 11
def self.datetime_to_timestamp(datetime)
  datetime.to_time.to_i
end