Added localtime variable to fix timezone issue