Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: Is Date.today in UTC?

Calling Date.today in Ruby returns the current date. However, what timezone is it in? I assume UTC, but I want to make sure. The documentation doesn't state either way.

like image 322
Matt Huggins Avatar asked Apr 18 '12 23:04

Matt Huggins


People also ask

What is UTC time now in 24 hour format?

UTC time in ISO-8601 is 20:22:20Z. Note that the Z letter without a space.


1 Answers

You can get away by using

Time.now.utc.to_date

in ruby

like image 175
vipulnsward Avatar answered Oct 21 '22 21:10

vipulnsward