# Setting user defined date range

**URL:** <https://discourse.bokeh.org/t/setting-user-defined-date-range/98>\
**Category:** Community Support\
**Created:** [May 22, 2014, 5:55pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98 "2014-05-22T17:55:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krackerjakk](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@krackerjakk](https://discourse.bokeh.org/u/krackerjakk)\
**Post date:** [May 22, 2014, 5:55pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98/1 "2014-05-22T17:55:12Z")

</div>

Is it possible to set the range for a time series data? I’ve tried converting the start and end datetimes to int/float as well.  
For example,

curplot().x\_range = Range1d(start=start\_date, end=end\_date)

I’ve also tried,

curplot().x\_range.start = start\_date  
curplot().x\_range.end = end\_date

Salil

---

<div class="post-metadata">

**Author:** ![Karan\_Dodia](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/9e8a1a/32.png) [@Karan\_Dodia](https://discourse.bokeh.org/u/Karan_Dodia)\
**Post date:** [May 22, 2014, 6:21pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98/2 "2014-05-22T18:21:46Z")

</div>

Hi Salil,

You _can_ set the range with a Range1d object, although you will have to coerce your datetime instances to milliseconds. Cells [3] and [9] in [this notebook](http://nbviewer.ipython.org/github/kdodia/drought-stats-tx/blob/master/Texas_Drought_Stats.ipynb) should explain the method in context.

We do have an open [issue](https://github.com/ContinuumIO/bokeh/issues/635) to decide how to best implement this going forward, so please feel free to add your input.

Thanks!

Karan

> **···**
>
> On Thu, May 22, 2014 at 12:55 PM, [krackerjakk@gmail.com](mailto:krackerjakk@gmail.com) wrote:
> 
> > Is it possible to set the range for a time series data? I’ve tried converting the start and end datetimes to int/float as well.  
> > For example,
> 
> > curplot().x\_range = Range1d(start=start\_date, end=end\_date)
> 
> > 
> 
> > I’ve also tried,
> 
> > curplot().x\_range.start = start\_date  
> > curplot().x\_range.end = end\_date
> 
> > 
> 
> > Salil
> 
> > –
> > 
> > You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to [bokeh+unsubscribe@continuum.io](mailto:bokeh+unsubscribe@continuum.io).
> > 
> > To post to this group, send email to [bokeh@continuum.io](mailto:bokeh@continuum.io).
> > 
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io?utm_medium=email&utm_source=footer).
> > 
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).

---

<div class="post-metadata">

**Author:** ![krackerjakk](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@krackerjakk](https://discourse.bokeh.org/u/krackerjakk)\
**Post date:** [May 22, 2014, 11:43pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98/3 "2014-05-22T23:43:50Z")

</div>

Thanks Karan. This works. I will take a look at the issue and hopefully have some suggestions that haven’t already been mentioned.

Salil

> **···**
>
> On Thursday, May 22, 2014 11:21:46 AM UTC-7, Karan Dodia wrote:
> 
> > Hi Salil,
> 
> > 
> 
> > You _can_ set the range with a Range1d object, although you will have to coerce your datetime instances to milliseconds. Cells [3] and [9] in [this notebook](http://nbviewer.ipython.org/github/kdodia/drought-stats-tx/blob/master/Texas_Drought_Stats.ipynb) should explain the method in context.
> 
> > 
> 
> > We do have an open [issue](https://github.com/ContinuumIO/bokeh/issues/635) to decide how to best implement this going forward, so please feel free to add your input.
> 
> > 
> 
> > Thanks!
> 
> > 
> 
> > Karan
> 
> > On Thu, May 22, 2014 at 12:55 PM, [krack...@gmail.com](mailto:krack...@gmail.com) wrote:
> > 
> > > Is it possible to set the range for a time series data? I’ve tried converting the start and end datetimes to int/float as well.  
> > > For example,
> 
> > > curplot().x\_range = Range1d(start=start\_date, end=end\_date)
> 
> > >
> 
> > > I’ve also tried,
> 
> > > curplot().x\_range.start = start\_date  
> > > curplot().x\_range.end = end\_date
> 
> > >
> 
> > > Salil
> 
> > > –
> > > 
> > > You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
> > > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [bokeh+un...@continuum.io](mailto:bokeh+un...@continuum.io).
> > > 
> > > To post to this group, send email to [bo...@continuum.io](mailto:bo...@continuum.io).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io?utm_medium=email&utm_source=footer).
> > > 
> > > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
> 
> >

---

<div class="post-metadata">

**Author:** ![krackerjakk](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@krackerjakk](https://discourse.bokeh.org/u/krackerjakk)\
**Post date:** [May 22, 2014, 11:44pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98/4 "2014-05-22T23:44:09Z")

</div>

Thanks Karan. This works. I will take a look at the issue and hopefully have some suggestions that haven’t already been mentioned.

Salil

> **···**
>
> On Thursday, May 22, 2014 11:21:46 AM UTC-7, Karan Dodia wrote:
> 
> > Hi Salil,
> 
> > 
> 
> > You _can_ set the range with a Range1d object, although you will have to coerce your datetime instances to milliseconds. Cells [3] and [9] in [this notebook](http://nbviewer.ipython.org/github/kdodia/drought-stats-tx/blob/master/Texas_Drought_Stats.ipynb) should explain the method in context.
> 
> > 
> 
> > We do have an open [issue](https://github.com/ContinuumIO/bokeh/issues/635) to decide how to best implement this going forward, so please feel free to add your input.
> 
> > 
> 
> > Thanks!
> 
> > 
> 
> > Karan
> 
> > On Thu, May 22, 2014 at 12:55 PM, [krack...@gmail.com](mailto:krack...@gmail.com) wrote:
> > 
> > > Is it possible to set the range for a time series data? I’ve tried converting the start and end datetimes to int/float as well.  
> > > For example,
> 
> > > curplot().x\_range = Range1d(start=start\_date, end=end\_date)
> 
> > >
> 
> > > I’ve also tried,
> 
> > > curplot().x\_range.start = start\_date  
> > > curplot().x\_range.end = end\_date
> 
> > >
> 
> > > Salil
> 
> > > –
> > > 
> > > You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
> > > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [bokeh+un...@continuum.io](mailto:bokeh+un...@continuum.io).
> > > 
> > > To post to this group, send email to [bo...@continuum.io](mailto:bo...@continuum.io).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/29aca71e-08c0-49a2-9d33-a3192fdf1ac1%40continuum.io?utm_medium=email&utm_source=footer).
> > > 
> > > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
> 
> >

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:04pm UTC](https://discourse.bokeh.org/t/setting-user-defined-date-range/98/5 "2021-07-21T21:04:02Z")

</div>


