解决方法
一个简单的答案是使用:
use POSIX; .... print strftime("%H:%M %Z",localtime);
但%Z返回的区域因系统而异.我在两个不同的平台上获得了GMT Daylight Time和BST.
编辑
以下是一个实验,表明(至少对我而言)%Z考虑了TZ
export TZ='' perl -MPOSIX -e 'print strftime("%H:%M %Z\n",localtime)' export TZ=America/Los_Angeles perl -MPOSIX -e 'print strftime("%H:%M %Z\n",localtime)'
产生输出
16:45 UTC 09:45 PDT