LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2022, 06:02 PM   #1
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
how to change timezone in a perl time variable?


I have many thousands of lines of data from a GPSDO (GPS Disciplined Oscillator) with a UTC date encoded as "yyyymmddhhmmss". I need to convert those to my local timezone (CST) for plotting with gnuplot. I first process the data with perl, which creates a text file that is used by gnuplot. I've skimmed through many pages of perl time examples on the net, but I can't make enough sense of it to do anything. Any help would be appreciated.

By the way, I am not proficient with perl. The processing code was given to me by someone else long ago, and I've made trivial changes to it over the years.

Last edited by Quakeboy02; 09-27-2022 at 06:04 PM.
 
Old 09-27-2022, 07:22 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Never mind. Looking through my archives yet again, I finally found an example of what I wanted. I missed it at first, because it's in the gnuplot script, not in the perl reformatting code.

example snippet:

data:
Code:
20220927000001|000.8| 538025

code:
Code:
zone=5*3600
...
plot '$PWD/temp/fll1.dat' using (timecolumn(1)-$zone):2  axes x1y2 title 'Position' with lines \
     lw 1 lc rgb "\#0000FF"

Last edited by Quakeboy02; 09-27-2022 at 08:26 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
timezone conversion in perl adambot Programming 5 01-09-2013 10:16 AM
AWK a variable Ouptut to a new variable and using the new variable with the old one alertroshannow Linux - Newbie 4 02-16-2009 12:08 AM
Timezone Conversion in Perl gjagadish Programming 1 12-13-2007 10:32 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration