Skip to content

bmordan/Ruby_time_object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Timecop Time.new enter image description here

A morning peep lecture for the September and October cohorts

Time.new
Time.year
Time.month
Time.hour
Time.second
Time.new.to_a
nicetime = Time.new
nicetime.strftime("%A the %-d of %B %Y")
nicetime.strftime("%r")
nicetime.strftime("%R")
nicetime.strftime("%x")

Add to a time

time = Time.new
time + (60*60*24*7)
time + (seconds,minutes,hours,days)

The DateTime object

require 'date'

DateTime.new(y,m,d,h,m,s)
Time.new.to_date

The TimeDifference gem

TimeDifference.between(time1,time2).in_seconds
TimeDifference.between(time1,time2).in_years
TimeDifference.between(time1,time2).in_each_component
TimeDifference.between(time1,time2).in_general

Check out our tests...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages