in reply to Re: Getting Weekly Dates
in thread Getting Weekly Dates

I think you're working at that too hard:
use Date::Manip; print map UnixDate($_, "%g\n"), ParseRecur("first monday of every mont +h in 2001");
which yields
Mon, 01 Jan 2001 00:00:00 -0800 Mon, 05 Feb 2001 00:00:00 -0800 Mon, 05 Mar 2001 00:00:00 -0800 Mon, 02 Apr 2001 00:00:00 -0800 Mon, 07 May 2001 00:00:00 -0800 Mon, 04 Jun 2001 00:00:00 -0800 Mon, 02 Jul 2001 00:00:00 -0800 Mon, 06 Aug 2001 00:00:00 -0800 Mon, 03 Sep 2001 00:00:00 -0800 Mon, 01 Oct 2001 00:00:00 -0800 Mon, 05 Nov 2001 00:00:00 -0800 Mon, 03 Dec 2001 00:00:00 -0800
Date::Manip does everything. From the docs:
I'm trying to build a library which can do _EVERY_ con- ceivable date/time manipulation that you'll run into in everyday life.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Getting Weekly Dates
by mothra (Hermit) on Mar 09, 2001 at 01:30 UTC
    ...If only Date::Manip wouldn't whine about not being able to figure out my timezone. :( (on NT4WS)
      use Date::Manip; Date_Init("TZ=PST");

      -- Randal L. Schwartz, Perl hacker


      update: later on, in the same manpage (huge) it says...
      Unable to determine TimeZone Perhaps the most common problem occurs when you get the error: Error: Date::Manip unable to determine TimeZone. Date::Manip tries hard to determine the local time- zone, but on some machines, it cannot do this (espe- cially non-unix systems). To fix this, just set the TZ variable, either at the top of the Manip.pm file, or in the DateManip.cnf file. I suggest using the form "EST5EDT" so you don't have to change it every 6 months when going to or from daylight savings time. Windows NT does not seem to set the TimeZone by default. From the Perl-Win32-Users mailing list: > How do I get the TimeZone on my NT? > > $time_zone = $ENV{'TZ'}; > You have to set the variable before, WinNT doesn't set i +t by default. Open the properties of "My Computer" and set a + SYSTEM variable TZ to your timezone. Jenda@Krynicky.cz This might help out some NT users.
        That worked. Thank you kindly for your help, it's just been one of those days. :)