Skip to content

Instantly share code, notes, and snippets.

View david-vo's full-sized avatar

David Vo david-vo

View GitHub Profile
@lee-dohm
lee-dohm / date_calculations.rb
Last active December 21, 2015 02:09
Stuff for David Vo
require 'date'
# Set the expriation to now plus 30 days
expriation = Time.now + (30 * 24 * 60 * 60)
# Output the filename in the desired format
puts expiration.strftime('discourse-%Y-%m-%d.dump')
# Or if you want the time too
puts expiration.strftime('discourse-%Y-%m-%d-%H-%M-%S.dump')