buildLocalTime function to make it easy to make changes