in reply to timelocal error when executed twice.
By the way, not all days have 86400 seconds. Use DateTime or some other module to do your arithmetic.