By the way - if you're extracting components to segment time you might
prefer temporal rounding
https://arrow.apache.org/docs/dev/cpp/compute.html?highlight=floor_temporal#conversions.

On Thu, Feb 3, 2022 at 5:19 PM Li Jin <ice.xell...@gmail.com> wrote:
>
> Gotcha. Thanks for the pointer!
>
> On Thu, Feb 3, 2022 at 11:06 AM Rok Mihevc <rok.mih...@gmail.com> wrote:
>
> > > Gotcha. "Assume timezone" is like "tz_localize" in pandas.
> >
> > Indeed!
> >
> > > I didn't see any target timezone information being passed in the "cast"
> > > function - how would I do that?
> >
> > Just cast with:
> > auto options = CastOptions::Safe(timestamp(TimeUnit::NANO,
> > "America/New_York"));
> > See examples in:
> >
> > https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/scalar_cast_test.cc
> >

Reply via email to