add one hour to each time field

Hello All,

Is there any *easy* and efficient way to add "one hour" to few fields in a file? . I have done this using a python script and it has hit with performance issues.

I have around 200mi of records, which I need to modify and send across in one hour.

 
sample input:
'2012-10-17 08:58:00.000','2012-08-17 10:29:56.000','2012-08-17 23:59:55.000','2012-10-17 06:58:00.000'
 
expexted output:
'2012-10-17 09:58:00.000','2012-08-17 11:29:56.000','2012-08-18 00:59:55.000','2012-10-17 07:58:00.000'

Thanks in advance.

As you don't mention your system, I can only offer what is working on my linux machine:

date -d'2012-08-17 23:59:55.000 + 1'
Sat Aug 18 00:59:55 CEST 2012

On FreeBSD, this should work:

date -j -v+1H -f"%Y-%m-%d %H:%M" "2012-10-17 23:55"
Thu Oct 18 00:55:56 CEST 2012

@panyam: Since we need to increase the date by an hour, we can use the date function to increment only if the hour is 23, else just adding one more to the hour component should do. If this can be incorporated in your script, we should be able to achieve it fairly quickly if I am not wrong.