Cannot display the timezone using perl DateTime andTimeZone

Solution Verified - Updated -

Issue

  • Script written in perl is unable to retrieve the timezone, on running the relevant code, it shows:
# perl -T -MDateTime::TimeZone::Local -le 'print DateTime::TimeZone::Local->TimeZone()->name'
Cannot determine local time zone

Environment

  • RHEL 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content