English 中文(简体)
铁路时间:现在
原标题:Ruby on Rails Time.now

我很麻烦。 出于某种原因,当我为非行避开标时,它就将其节省了2000年。 我试图将非行所节省的物体一与时间相比较。 现在,如果检查更多,但从2000年起,检查总是不实。 是否有任何人知道我可以为此而努力?

我只需要检查,以确保自我设定一个与时间相比的时间目标以来已经过去了10分钟。 现在

最佳回答

如贵国数据库一栏所示为<代码> 时。 而不是<代码> 日期或<代码> 时stamp。 这只能储存时间,如果转换成<代码> 日,例如废墟(确实支持日、月、年等)的缺省值,则用于日、月、年,这就是为什么你重新看到2000年。

或许需要更新贵国的数据库栏,以作为<代码> 日或<代码> 如果这是问题,正如你一样,它需要时间的一天、月、一年。 如果是的话,你将重新进行比较。

问题回答

。 工作





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签