Time Introduction : Time class « Time « Ruby






Time Introduction


puts Time.now                                   
puts Time.at(0)                                 
puts t = Time.at(0)
puts t.sec                                      
puts t.min                                      
puts t.hour                                     
puts t.day                                      
puts t.month                                    
puts t.year                                     
puts t.wday                                     
puts t.yday                                     
puts t.isdst                                    
puts t.zone                                     

 








Related examples in the same category

1.Time Object Methods Used to Access Date/Time Attributes
2.Time represented internally as seconds since the (platform-dependent) epoch