Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to run logwatch at follows

[root@machine cron.daily]# ./0logwatch 
ERROR: Date::Manip unable to determine TimeZone.

Execute the following command in a shell prompt:
        perldoc Date::Manip
The section titled TIMEZONES describes valid TimeZones
and where they can be defined.

My date is as follows

root@machine cron.daily]# date
Thu Aug 23 06:25:21 GMT 2012

Now based on details in various forums I tried to fix this by setting

/etc/timezone to “+0800”

but it didn’t work

My /etc/localtime points to /usr/share/zoneinfo/GMT and is managed by puppet

How do I go about fixing this? I still want all my machines to be in GMT timezone.

Both the changes are not working:

[root@machine cron.daily]# cat /etc/TIMEZONE 


[root@machine cron.daily]# cat ~/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc

# User specific environment and startup programs

export TZ=GMT

export PATH
[root@machine cron.daily]# source ~/.bash_profile
[root@machine cron.daily]# ./0logwatch 
ERROR: Date::Manip unable to determine TimeZone.

Execute the following command in a shell prompt:
        perldoc Date::Manip
The section titled TIMEZONES describes valid TimeZones
and where they can be defined.
share|improve this question
Have you tried following instruction provided at and manage symlink with puppet? – user130370 Aug 27 '12 at 8:48
updated my answer. – quanta Aug 30 '12 at 3:59

Your current timezone is GMT, why did you set /etc/timezone to "+0800"?

perldoc Date::Manip

   The following time zone names are currently understood (and can be used in parsing dates).  These are zones
   defined in RFC 822.

       Universal:  GMT, UT
       US zones :  EST, EDT, CST, CDT, MST, MDT, PST, PDT
       Military :  A to Z (except J)
       Other    :  +HHMM or -HHMM
       ISO 8601 :  +HH:MM, +HH, -HH:MM, -HH

   In addition, the following time zone abbreviations are also accepted. These do not come from a standard, but were
   included in previous releases of Date::Manip 5.xx and are preserved here for backward compatibility:

      IDLW    -1200    International Date Line West
      NT      -1100    Nome
      SAT     -0400    Chile
      CLDT    -0300    Chile Daylight
      AT      -0200    Azores
      MEWT    +0100    Middle European Winter
      MEZ     +0100    Middle European
      FWT     +0100    French Winter
      GB      +0100    GMT with daylight savings
      SWT     +0100    Swedish Winter
      MESZ    +0200    Middle European Summer
      FST     +0200    French Summer
      METDST  +0200    An alias for MEST used by HP-UX
      EETDST  +0300    An alias for eest used by HP-UX
      EETEDT  +0300    Eastern Europe, USSR Zone 1
      BT      +0300    Baghdad, USSR Zone 2
      IT      +0330    Iran
      ZP4     +0400    USSR Zone 3
      ZP5     +0500    USSR Zone 4
      IST     +0530    Indian Standard
      ZP6     +0600    USSR Zone 5
      AWST    +0800    Australian Western Standard
      ROK     +0900    Republic of Korea
      AEST    +1000    Australian Eastern Standard
      ACDT    +1030    Australian Central Daylight
      CADT    +1030    Central Australian Daylight
      AEDT    +1100    Australian Eastern Daylight
      EADT    +1100    Eastern Australian Daylight
      NZT     +1200    New Zealand
      IDLE    +1200    International Date Line East

   All other time zone abbreviations come from the standards. In many cases, an abbreviation may be used for multiple
   timezones. For example, NST stands for Newfoundland Standard -0330 and North Sumatra +0630.  In these cases, only
   1 of the two is available. I have tried to use the most recent definition, and of those (if multiple timezones use
   the abbreviation), the most commonly used. I don’t claim that I’m correct in all cases, but I’ve done the best I

   The list of abbreviations available is documented in the Date::Manip::DM5abbrevs document in this module, or more
   fully in the Date::Manip::Zones document of Date::Manip::6.xx.

   Date::Manip must be able to determine the time zone the user is in.  It does this by looking in the following

      $Date::Manip::TZ (set with Date_Init or in
      the Unix ‘date‘ command (if available)

   At least one of these should contain a time zone in one of the supported forms.  If none do by default, the TZ
   variable must be set with Date_Init.

   The time zone may be in the STD#DST format (in which case both abbreviations must be in the table above) or any of
   the formats described above.  The STD#DST format is NOT available when parsing a date however.  The following
   forms are also available and are treated similar to the STD#DST forms:


Which Date::Manip version are you running?

If for some reasons, Perl doesn't read /etc/timezone or /etc/TIMEZONE, you can add this line into /root/.bash_profile:

export TZ=GMT

Make it takes effect immediately by running source /root/.bash_profile and try again.

UPDATE Thu Aug 30 10:55:54 ICT 2012

Try setting the timezone in your logwatch perl script:

use Date::Manip;

share|improve this answer
up vote 2 down vote accepted

Actually this worked

share|improve this answer

That's not a fix, it's a workaround. But it should get you going.

The reason it didn't work is that it's expecting TIMEZONE to be capitalized.

echo UTC > /etc/TIMEZONE
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.