class Time

Public Instance Methods

lsish() → str click to toggle source

Build a time string like in ls -l. When the year is the current, show the time. While ls doesn't show the seconds, this will allways include them.

Time.now.lsish           #=> " 8. Oct 15:15:19"
file.stat.mtime.lsish    #=> " 1. Apr 2008    "
# File lib/humansiz.rb, line 107
def lsish
  strftime "#{PERC_DAY}. %b " +
            (year == Time.now.year ? "%H:%M:%S" : "%Y    ")
end