class DateTime

def to_s_lex(precision = :day)

return:: a lexicographically sortable string representing the date
options are :year, :month, :day, :hour, :minute and :second
precision:: the precision required in the string version of the date. The

required precision. The format used is %Y%m%d %H:%M:%S.
Convert the DateTime to a lexicographically sortable string with the
def to_s_lex(precision = :day)
  self.strftime(Time::LEX_FORMAT[precision])
end