I have a ruby app that I have developed that archives and backs up my files. What I'm trying to do is have it backup at the end of each month all files for that month, e.i on March 31 backup all files with March time stamps. Apart from me writing regex to do this does anyone know a better way of handling this?
Use Date ranges:
(Date.new(2012, 2, 1)..Date.new(2012,2,29)).include? Date.new(2012, 2, 23)
#=> true
(Date.new(2012, 2, 1)..Date.new(2012,2,29)).include? Date.new(2012, 3, 23)
#=> false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With