use POSIX 'strftime'; print strftime($format,localtime(time + $offset));