Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Time calculation
Name: Xerex Date: August 16, 2004 at 15:36:05 Pacific OS: UNIX CPU/Ram: Solaris
Comment:
Hi,
If I were to script the whole thing by splitting the time string into its component parts..I am not that familiar with this. Can somebody help me through this? Here's another examle I wan't to do. Please see below: My time is in 24 hrs. setting. I just want to deduct the time 05:22 a.m. to 11:23 a.m. to get the hr. difference. Thanks
Summary: #!/bin/ksh # At script beginning, get day of month. BDAY=$(date +%e) # Get time in seconds. ((BTIME=($(date +%H)*3600)+($(date +%M)*60)+$(date +%S))) # # script # # At script end, get the end day of m...
Summary: the best thing to do is use perl's stat function #!/usr/bin/perl -w @file_info = stat("../../rel/path/to/file"); $time = time; #calculate the difference in seconds $diff_sec = ($time - $file_info[9]);...