Ah, unfortunate that you cannot reproduce it, but thank you for taking a
look into it. Definitely seems to be something in
mktime/rb_time_timespec_new as you suggest.

I agree with the moral of the story, haha!

Thanks,
Charlie

On Wed, Sep 28, 2022 at 2:21 PM Jeremy Evans <[email protected]> wrote:

> In my environment, with sequel_pg, your example gives:
>
> 2021-11-07 01:35:44 -0700
> 2022-02-21 08:22:37 -0800
> 2021-11-07 01:35:44 -0700
> 2021-03-23 08:36:22 -0700
> 2021-11-07 01:35:44 -0700
>
> With NO_SEQUEL_PG, your example gives:
>
> 2021-11-07 01:35:44 -0800
> 2022-02-21 08:22:37 -0800
> 2021-11-07 01:35:44 -0800
> 2021-03-23 08:36:22 -0700
> 2021-11-07 01:35:44 -0800
>
> So I don't see the issue you are seeing where the same timestamp can
> return different values.  However, the behavior does change when sequel_pg
> is used.  As the underlying timestamp value is ambiguous, I would consider
> either behavior correct, and therefore I don't think is a bug.  The cause
> of the behavior change is likely due to the use of
> mktime/rb_time_timespec_new in sequel_pg.
>
> The moral of this story is to use timestamptz instead of timestamp if you
> care about timestamp offsets.  Sequel ships with a pg_timestamptz Database
> extension that will use timestamptz instead of timestamp for Time/DateTime
> generic types.
>
> Thanks,
> Jeremy
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sequel-talk" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sequel-talk/25-pPTalIes/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sequel-talk/CADGZSSecRuD5yf%2Bo3iMFcCF7weid931UopT-S6mMGkr-E99H6w%40mail.gmail.com
> <https://groups.google.com/d/msgid/sequel-talk/CADGZSSecRuD5yf%2Bo3iMFcCF7weid931UopT-S6mMGkr-E99H6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CAOEi_SoeVVAeMXTVh1L5OC8SY2R8ZSA0RO0g0hH_Rp_eqY7SJg%40mail.gmail.com.

Reply via email to