LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ERROR: Date::Manip unable to determine TimeZone. (https://www.linuxquestions.org/questions/linux-newbie-8/error-date-manip-unable-to-determine-timezone-4175413970/)

ewalter 06-29-2012 03:08 AM

ERROR: Date::Manip unable to determine TimeZone.
 
Am using centos on one of my servers but when i run logwatch "sh /etc/cron.daily/logwatch.cron" i get
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.

I've installed every little thing that has to do with Date::Manip so the problem can't be with perl's date!!
But today morning when i ran /etc/init.d/ntpd status
it returned:
ntpd dead but pid file exists
Could that be the cause of the above, please advise coz am so desperate. tnx

Kustom42 06-29-2012 02:31 PM

Restart ntpd with your command /etc/init.d/ntpd restart.

Check this info out for setting your timezone:

http://www.thegeekstuff.com/2010/09/...zone-in-linux/

It is controlled by the file /etc/localtime and there are some files in /usr/share/zoneinfo/ that you can copy to that location to change it.

TB0ne 06-29-2012 02:58 PM

Quote:

Originally Posted by ewalter (Post 4714797)
Am using centos on one of my servers but when i run logwatch "sh /etc/cron.daily/logwatch.cron" i get
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.

I've installed every little thing that has to do with Date::Manip so the problem can't be with perl's date!! But today morning when i ran /etc/init.d/ntpd status it returned:
ntpd dead but pid file exists
Could that be the cause of the above, please advise coz am so desperate. tnx

Spell out your words. And the Date::Manip::TZ package addresses this, if you don't implicitly set the timezone in your Perl program:
http://search.cpan.org/~sbeck/Date-M...STEM_TIME_ZONE

You can try a few things:
  • Set the timezone at the beginning of your script like
    Code:

    TZ=PST8PDT
  • Check the contents of /etc/sysconfig/clock, and look for the TIMEZONE and DEFAULT_TIMEZONE values. Put the TIMEZONE line in the /etc/TIMEZONE file.
  • Use the Date::Manip:TZ module too


All times are GMT -5. The time now is 03:55 PM.