Date and time Arithmetic

Hi,

I need to process a file which contains below data. Usually the files contains both Start and Finish time. but for Few records, it contains only Start. For those records I need to add the finish line by adding 5 minutes to Start time.

Started BBIDX Tue Jun 1 15:15:11 EDT 2010 292308 indx_extbo_euro.px.20100601
Finished BBIDX Tue Jun 1 15:24:47 EDT 2010 292308 indx_extbo_euro.px.20100601
Started BBID Tue Jun 1 23:55:11 EDT 2010 292308 indx_extbo_euro.px.20100601

For example in above BBID does not have Finish time, So I need to 5 minutes to start tiem so the tne new line would be

Finished BBID Wed Jun 2 00:00:11 EDT 2010 292308 indx_extbo_euro.px.20100601

Can Any one please help me. It contains some Date and time Arithemetic. I am confused where to start.

have a look at the FAQ article:

http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

:wink: