Hi all, Using the Chronic.parse method, I see some weird behavior. Perhaps someone can set me straight or confirm that it is indeed weird. Note that the date changes to one day earlier in the last example below. Since the date and time are uniquely specified using the hh:mm:ss notation -- though in the future -- I would expect the same result as when I specify the time as in ''4pm''. Thanks in advance for any thoughts on this. -cal>> Chronic.parse("now", :context => :past)=> Wed Feb 20 11:17:36 -0500 2008>> Chronic.parse("2008-02-20", :context => :past)=> Wed Feb 20 12:00:00 -0500 2008>> Chronic.parse("2008-02-20 10am", :context => :past)=> Wed Feb 20 10:00:00 -0500 2008>> Chronic.parse("2008-02-20 10:00:00", :context => :past)=> Wed Feb 20 10:00:00 -0500 2008>> Chronic.parse("2008-02-20 4pm", :context => :past)=> Wed Feb 20 16:00:00 -0500 2008>> Chronic.parse("2008-02-20 16:00:00", :context => :past)=> Tue Feb 19 16:00:00 -0500 2008 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ahem. Anyone home? On Feb 20, 2:33 pm, cal <lesb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > Using theChronic.parsemethod, I see some weird behavior. Perhaps > someone can set me straight or confirm that it is indeed weird. Note > that the date changes to one day earlier in the last example below. > Since the date and time are uniquely specified using the hh:mm:ss > notation -- though in the future -- I would expect the same result as > when I specify the time as in ''4pm''. Thanks in advance for any > thoughts on this. > > -cal > > >>Chronic.parse("now", :context => :past) > > => Wed Feb 20 11:17:36 -0500 2008>>Chronic.parse("2008-02-20", :context => :past) > > => Wed Feb 20 12:00:00 -0500 2008>>Chronic.parse("2008-02-20 10am", :context => :past) > > => Wed Feb 20 10:00:00 -0500 2008>>Chronic.parse("2008-02-20 10:00:00", :context => :past) > > => Wed Feb 20 10:00:00 -0500 2008>>Chronic.parse("2008-02-20 4pm", :context => :past) > > => Wed Feb 20 16:00:00 -0500 2008>>Chronic.parse("2008-02-20 16:00:00", :context => :past) > > => Tue Feb 19 16:00:00 -0500 2008--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Chronic parsing date range in console but not in application in rails 3
- undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span
- Easy Date question - newb
- read-only access to database?
- Heroku, needs constant AppController updates?