# Chronic parse problem?

**URL:** <https://www.ruby-forum.com/t/chronic-parse-problem/196598>\
**Category:** Ruby\
**Created:** [February 20, 2008, 8:35pm UTC](https://www.ruby-forum.com/t/chronic-parse-problem/196598 "2008-02-20T20:35:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@cal](https://www.ruby-forum.com/u/cal)\
**Post date:** [February 20, 2008, 8:35pm UTC](https://www.ruby-forum.com/t/chronic-parse-problem/196598/1 "2008-02-20T20:35:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@cal](https://www.ruby-forum.com/u/cal)\
**Post date:** [February 21, 2008, 2:58am UTC](https://www.ruby-forum.com/t/chronic-parse-problem/196598/2 "2008-02-21T02:58:00Z")

</div>

Hi there,

On Thu, Feb 21, 2008 at 6:35 AM, cal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Chronic.parse(“2008-02-20 16:00:00”, :context =\> :past)  
> > > =\> Tue Feb 19 16:00:00 -0500 2008

I haven’t used Chronic before, but it seems if you’re asking for 4pm, in  
the  
past, on the 20th of February, it’s a hard order to fill when it’s only  
11am  
on the 20th now. What other options are there for :context, what does it  
do?

Cheers,  
Arlen
