Hello,
Why Time.now - 86400 works?
but when I tried Time.now(-86400) it won’t work.
I was thinking -86400 is an argument for the class method “now”.
Thanks.
Hello,
Why Time.now - 86400 works?
but when I tried Time.now(-86400) it won’t work.
I was thinking -86400 is an argument for the class method “now”.
Thanks.
Time.now.-(86400)
“- is the method here on the Time object that Time.now returns…”
–
Thanks & Regards,
Dhruva S…
2010/11/18 Eva [email protected]
On Thu, 18 Nov 2010 02:25:53 -0500
Eva [email protected] wrote:
Why Time.now - 86400 works?
but when I tried Time.now(-86400) it won’t work.
I was thinking -86400 is an argument for the class method “now”.
Time.now cannot take any arguments.
So Time.now(-86400) or Time.now -86400 fails.
But that’s not how your first line is being interpretted. You’re
creating a new Time object (with zero arguments) and then subtracting
86400 seconds from it.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs