Get current time in Rails app
You could use Time.current instead of Time.zone.now.
There is also Date.current which is timezone aware version of Date.today.
Written by Sergey Nartimov
Related protips
3 Responses
Wow! :)
over 1 year ago
·
Did you mean Date.current?
over 1 year ago
·
@soulim Thanks! Fixed.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#