module LiveJournal::Request

Public Class Methods

ljtime_to_time(str) click to toggle source

Convert an ljtime to a Time.

# File lib/livejournal/request.rb, line 42
def self.ljtime_to_time str
  dt = DateTime.strptime(str, '%Y-%m-%d %H:%M')
  Time.gm(dt.year, dt.mon, dt.day, dt.hour, dt.min, 0, 0)
end
time_to_ljtime(time) click to toggle source

ljtimes look like 2005-12-04 10:24:00. Convert a Time to an ljtime.

# File lib/livejournal/request.rb, line 38
def self.time_to_ljtime time
  time.strftime '%Y-%m-%d %H:%M:%S'
end