help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem processing data logs


From: Ian McCallion
Subject: Problem processing data logs
Date: Thu, 3 Jan 2019 13:25:23 +0000

I will be receiving data logs from several places across the world which I wish to process and present in the appropriate local timezone. Since the event times are in UTC I need a function to convert UTC to time in the appropriate timezone. I have tried:

function lt =  mylocaltime(EventSecondsSinceEpoch, timezonestring)   
   setenv('tz','EST5EDT,M3.2.0/02:00:00,M11.1.0')
   lt = localtime(EventSecondsSinceEpoch)
   setenv('tz','')
endfunction

but (at least on windows 10 with Octave 4.4.1) this does not work. This however does work:

function lt =  mylocaltime(EventSecondsSinceEpoch, timezonestring)     
   setenv('tz','EST5EDT,M3.2.0/02:00:00,M11.1.0')
   pause(1)
   lt = localtime(EventSecondsSinceEpoch)
   setenv('tz','')
endfunction

Unfortunately as well as taking a second for a microsecond's worth of computation it causes unacceptable secondary effects on Octave itself, such as any file open in the Octave editor being reported as out of date.

Is there another way to implement  mylocaltime()  in Octave without recoding from scratch the logic needed to process a timezone string?

Cheers... Ian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]