Project

timetoday

0.0
No commit activity in last 3 years
No release in over 3 years
Returns a random time today, or within a few days (e.g. "4 days"), or between a few days (e.g. "2-3 days")
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.8, ~> 0.1
>= 0.10.6, ~> 0.10
 Project Readme

Introducing the TimeToday gem version 0.2.0

require 'timetoday'

# return any time today
TimeToday.any    #=> 2014-02-15 09:25:49 +0100

# return a future time today
TimeToday.future #=> 2014-02-15 19:23:33 +0100

# return a random time within a range
TimeToday.between '5pm', '7pm' #=> 2014-02-15 17:40:12 +0000 

# return a time which is within 5 minutes relative to the current time
Time.now                     #=> 2014-06-07 17:09:49 +0100 
TimeToday.within '5 minutes' #=> 2014-06-07 17:12:14 +0100 

# return a random time 2 to 3 days from now
Time.now                          #=> 2015-05-26 11:47:16 +0100
TimeToday.new.between '2-3 days'  #=> 2015-05-29 01:43:28 +0100 

The TimeToday returns a random time object for today. The time can either be any time today, any time between now and midnight, or a relative time within a given duration.

Resources

timetoday gem random time day