Related questions
Ruby/Rails: converting a Date to a UNIX timestamp
How would I get a UNIX timestamp (number of seconds since 1970 GMT) from a Date object in a Rails app?
I know Time#to_i returns a timestamp, but doing Date#to_time and then getting the timestamp results in …
Rails formatting date
I am posting a date to an API and the required format is as follows:
2014-12-01T01:29:18
I can get the date from the model like so:
Model.created_at.to_s
That returns:
2014-12-01 01:29:18 -0500
How can …
How do I validate a date in rails?
I want to validate a date in my model in Ruby on Rails, however, the day, month and year values are already converted into an incorrect date by the time they reach my model.
For example, if I enter February 31…