Date and time format question

Bob Sneidar bobsneidar at iotecdigital.com
Mon Jul 29 19:52:59 EDT 2024


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 at 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 <bobsneidar at 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 at 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
>>>> 
>>>> 



More information about the use-livecode mailing list