Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set timezone in gnuplot?

Tags:

gnuplot

I have a simple gnuplot command file:

 ....
set xdata time
set timefmt "%s"
set format x "%H:%M"
....

where x - timestamp column.

Result - time in UTC format. Can I change local timezome for x axis ?

like image 235
Bdfy Avatar asked Jan 15 '13 14:01

Bdfy


2 Answers

Just came across this in the docs today:

The conversion to and from seconds assumes Universal Time (which is the same as Greenwich Standard Time). There is no provision for changing the time zone or for daylight savings. If all your data refer to the same time zone (and are all either daylight or standard) you don't need to worry about these things. But if the absolute time is crucial for your application, you'll need to convert to UT yourself.

From help time/date

like image 62
mgilson Avatar answered Sep 30 '22 13:09

mgilson


I just ran across this today. You don't need to change the format, just change the data. If data.txt contains timestamps in UTC, and you want to display them in PDT (-7 hours off from UTC), simply use:

plot 'data.txt' using ($1+(-7*3600)):2

This subtracts 7 hours (in seconds) from each x value.

like image 32
KeithB Avatar answered Sep 30 '22 11:09

KeithB