some more fixes to buildLocalTime and getDateTime and made it inline