The time is returned as a Time object : mtime « File Directory « Ruby






The time is returned as a Time object

t = File.mtime("text.txt")
puts t.hour
puts t.min
puts t.sec

 








Related examples in the same category

1.To establish when a file was last modified, use File.mtime: