in reply to function to add time

You will probably find that DateTime::Duration does what you want.

/J\