Fixed incorrect time calculation.

When using posix_time with boost::asio one can't use local_time
directly.