Fixed local time calculation, replace deprecated function