Monday, March 26, 2007

Ruby tutorial: http://www.ruby-lang.org/en/

Program to convert epoch integer following "epoch_time" to human-readable string.

if __FILE__ == $0
IO.foreach("querylog.txt") {
|x|
print "" + (x[0,10] == "epoch_time" ?
x[0,10] + ": " + (Time.at(x[11..x.size].to_i)).to_s + "\n" :
x)
}
end

No comments: