in reply to Categorize rows on the basis of unix time

Unix time is in UTC, based from the Epoch time. So just subtract all times from the start time. This will be number of seconds since the input file started collecting data.

You can calculate the hours manually: 60 seconds * 60 min = 1 hour. All days have 24 hours since we are dealing with GMT(UTC) time instead of funny daylight savings time.

Alternately, you can use any of the epoch to string functions like the use POSIX qw(strftime); module directly on this new start of data quasi epoch time. Just ignore the Jan 1970 stuff and only care about hour and day of month.

Update: whipped out my calculator, 1291154399 - 1290895200 = 259199. 60 sec * 60 sec/min *24 hours/day *3 days = 259200 seconds. So I'd keep it simple. Subtract 1290895200 from all the rest of the times. Hour one is from 0 to 60*60*1 seconds, hour 2 from that until 60*60*2 seconds, etc.