johnnybd29 has asked for the wisdom of the Perl Monks concerning the following question:

In the DateTime module I change the timezone to 'local', and the module changes directories to get the information, but when the set_time_zone() returns, the directory is not changed back to the current working directory. Any ideas about this?? thanks....

Replies are listed 'Best First'.
Re: DateTime module
by adrianh (Chancellor) on Feb 03, 2004 at 22:54 UTC

    Sounds like a bug. Wrap up a test case, make sure the bug still occurs in the latest version of DateTime, and let the nice folk at http://datetime.perl.org/ know ;-)

Re: DateTime module
by PodMaster (Abbot) on Feb 04, 2004 at 06:17 UTC
    Any ideas about this?? thanks....

    What code are you running? Which versions of DateTime and DateTime::TimeZone do you have? (these are crucial details)

    I encounter no such behaviour, see

    use DateTime; use Cwd 'cwd'; use strict; use warnings; print 'DateTime->VERSION ', DateTime->VERSION,$/; print 'DateTime::TimeZone->VERSION ', DateTime::TimeZone->VERSION,$/; print cwd,$/; eval { DateTime->now( time_zone => 'local' ); 1} or print $@,$/; DateTime->now( time_zone => 'America/Los_Angeles' ); print cwd,$/; __END__ DateTime->VERSION 0.1901 DateTime::TimeZone->VERSION 0.2503 C:/dev/LOOSE Cannot determine local time zone C:/dev/LOOSE
    I'm using ActivePerl flavored perl on win32.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: DateTime module
by KPeter0314 (Deacon) on Feb 03, 2004 at 22:51 UTC
    Could you post some code? It isn't clear why you think the directory should be changed back to the previous working directory after a set_time_zone() call. The call itself shouldn't do that, your code should.

    I'll assume you are using the DateTime module.

    -Kurt

Re: DateTime module
by lestrrat (Deacon) on Feb 04, 2004 at 09:18 UTC

    I have a feeling you are one the persons who posted to datetime mailing list so you already may know the answer, but I'll post for completeness.

    That bit is apparently from DateTime using File::Find, which in turn seems to leave you at wherever you found the file you were searching, unless you use the no_chdir option or something. Dave's aware of it