Page 1 of 1

mass add time in a file

Posted: Sun Mar 21, 2010 12:38 am
by atinder
i have a file in which time appears nearly hundred times
like
00:01:32
00:01:33
00:01:36
.......................

how can i add 2 seconds or 2 minutes to all the times in the file so that i get

00:01:34
00:01:35
00:01:38

..................
:banghead:

Re: mass add time in a file

Posted: Sun Mar 21, 2010 1:59 am
by Christopher
What format is the file in? You would read the file, extract the time, convert it with the date functions (http://us.php.net/manual/en/ref.datetime.php) and write the file back out.