[Kst] Reading formatted dates and mixing with ctimes

David McMinn david.mcminn at iwcdownhole.com
Thu Jun 27 14:27:18 UTC 2013


Hi,

I have two separate data files, both ASCII, both time/value. They are not sampled or aligned in the time axis. I'd like to be able to plot them in two separate plots but have their zoom tied so that I can visually see the corresponding data.

The first data set has the time in seconds since the UNIX epoch, so I'm reading that in interpreting the column as C Time. This is fine.

The second data set has the time formatted as "dd/MM/yy-hh:mm:ss", so I read that in as a formatted time with the above format string. That also seems to read in OK. The values I get are in the range 178458000 + 6e4, corresponding to date/times in the range 13 June 2013 23:00:00 to 15 June 2013 02:16:30. I don't know if that's right as I'm not sure what the QDateTime representation is.

Now the problems start. Whatever I set my X axis "interpret as" setting to I cannot get the date/time for the second data file to be displayed as a date/time that is displayed "sensibly", such as 13/06/2013 23:00 with the additional time in square brackets, as KST does for C Time. The closest I can get is interpreting it as a C Time and displaying with a custom format string of "dd/MM/yy hh:mm:ss" otherwise it seems to have picked the date up as 1913, which I guess is because 1.78e9 loops round to 1913. This obviously stops the tied zoom from working.

Other interpretations end up with the above 1.78e9 numbers or 12:00:00 with spans of hundreds or thousands of years.

What's the best way to read in a formatted time and have it displayed as a timestamp?

Is it possible to align two plots on date/time rather than the numerical value of their timestamp?

Thanks.




More information about the Kst mailing list