fix: undefined index
fix: warning undefined variable
fixed warning: It is not safe to rely on the system's timezone settings