mass add time in a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
atinder
Forum Newbie
Posts: 2
Joined: Sat Jan 30, 2010 2:36 pm

mass add time in a file

Post 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:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: mass add time in a file

Post 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.
(#10850)
Post Reply