CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
subtracting from data column PLEASE HELP


New User

May 26, 2011, 1:40 PM

Post #1 of 2 (4309 views)
subtracting from data column PLEASE HELP Can't Post

so i have a column of time data in the format
061256.76 (which is 6:12 AM and 56.76 sec)
which the first two digits are hrs, then min, sec, and milliseconds
The time is currently in universal time and needs to be adjusted to local time by subtracting 4 hrs
If I subtract four each data point in the column I will get
061254.76 for example which is 6:12 and 54.76 sec but I want 2:12 and 56.76 sec
I need to move the hrs back 4 hrs, so I only want to subtract from 04 from the first two digits, any suggestions?

*The numbers above are simply an example, it needs to work for an entire column of time data (in the same format as above)

(This post was edited by pinto106 on May 27, 2011, 6:48 AM)


May 26, 2011, 3:25 PM

Post #2 of 2 (4307 views)
Re: [pinto106] subtracting from data column [In reply to] Can't Post

It's not pretty, but it works.

my $num = '061254.76'; 
# 061254.76
$num -= 40000
# 21254.76


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives