Created
September 16, 2011 18:21
-
-
Save seabre/1222746 to your computer and use it in GitHub Desktop.
Get Datetime in the Currently Set Timezone in Rails for the Beginning of the Next Month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get datetime for the beginning of the next month in the timezone that's currently set. | |
one_month_ahead = Time.zone.now.at_beginning_of_month.next_month | |
#You can format the datetime the way you want as well. | |
one_month_ahead = Time.zone.now.at_beginning_of_month.next_month.strftime("%Y-%m-%d %T %z") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment