1

I'm still new to perl and want to write a perl script/function that can set the timezone on a windows machine (locally) to a different time zone. For example if it's really Americas/Los_Angeles, I want to set it to something new like Americas/New_York or some other country's time zone. What's the best way to write this?

Thanks!

  • How about opening the Control Panel and doing it yourself? What are you using this for anyway...? – TLP Feb 28 '12 at 13:39

1 Answers1

1

$ENV{TZ} = 'America/New_York';

Be sure to follow this discussion - and advice about POSIX::tzset in particular - if you intend to use localtime in your script as well.

Community
  • 1
  • 1
raina77ow
  • 103,633
  • 15
  • 192
  • 229