Yeah but I think I got the math backwards. -0400 means the GMT is 4 hours AHEAD not behind. It should be subtract tOffset from tDateTime.
Bob S > On Jul 29, 2024, at 4:11 PM, Paul Dupuis via use-livecode > <use-livecode@lists.runrev.com> wrote: > > Thanks! You math to do the offset is much simpler. > > On 7/29/2024 6:34 PM, Bob Sneidar via use-livecode wrote: >> Meh never mind overthinking it. Both ways work. >> >> Bob S >> >> >>> On Jul 29, 2024, at 3:30 PM, Bob Sneidar <bobsnei...@iotecdigital.com> >>> wrote: >>> >>> Actually it’s possible in some whacko time zones to get a rounding error by >>> dividing first so: >>> >>> … >>>> put (tOffset *60 *60) /100 into tOffset >>> … >>> >>> Bob S >>> >>> >>>> On Jul 29, 2024, at 3:14 PM, Bob Sneidar via use-livecode >>>> <use-livecode@lists.runrev.com> wrote: >>>> >>>> Simpler than that: >>>> >>>> on mouseUp >>>> put "Mon, 29 Jul 2024 15:49:52 -0400" into tDateTime >>>> put word -1 of tDateTime into tOffset >>>> -- delete last word of tDateTime >>>> convert tDateTime to seconds >>>> put (tOffset / 100) *60 *60 into tOffset >>>> add tOffset to tDateTime >>>> convert tDateTime to long date and long time >>>> put tDateTime >>>> end mouseUp >>>> >>>> Bob S >>>> >>>> _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode