# Date and time Arithmetic

**URL:** <https://community.unix.com/t/date-and-time-arithmetic/268132>\
**Category:** Shell Programming and Scripting\
**Created:** [June 22, 2010, 10:33am UTC](https://community.unix.com/t/date-and-time-arithmetic/268132 "2010-06-22T10:33:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![siba.s.nayak](https://community.unix.com/letter_avatar/siba.s.nayak/32/5_5575768a8748004e209b776fc1b2916d.png) [@siba.s.nayak](https://community.unix.com/u/siba.s.nayak)\
**Post date:** [June 22, 2010, 10:33am UTC](https://community.unix.com/t/date-and-time-arithmetic/268132/1 "2010-06-22T10:33:24Z")

</div>

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.

```nohighlight
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

```nohighlight
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.

---

<div class="post-metadata">

**Author:** ![Tytalus](https://community.unix.com/user_avatar/community.unix.com/tytalus/32/87_2.png) [@Tytalus](https://community.unix.com/u/Tytalus)\
**Post date:** [June 22, 2010, 10:48am UTC](https://community.unix.com/t/date-and-time-arithmetic/268132/2 "2010-06-22T10:48:00Z")

</div>

have a look at the FAQ article:

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

😉
