DateTime::Format::Excel improvement

2007-02-07 Thread Metz, Bobby
The parse_datetime routine in DateTime::Format::Excel is 100% when converting dates from the Excel serial date format, but I found it doesn't convert the time portion of a value, i.e. the decimal portion of the float. For example, the following code: my $datetime =

RE: DateTime::Event again

2007-05-16 Thread Metz, Bobby
At a high level, recurring and single events don't have to have different properties IMO, depending on how you structure the series of event references. If you separate the event information from the scheduling, having an array, hash, whatever of scheduled events would simply hold references to

RE: Simple math: partitioning the time between two DateTimes

2007-08-07 Thread Metz, Bobby
I thought the first solution posted to your use Perl article was decent: sub partition { my ($start, $end, $n) = @_; my $s = $start-epoch; my $e = $end-epoch; my $i = int( ($e - $s) / $n );# interval return map DateTime-from_epoch(epoch = $s + $i * $_), 0 .. $n; } But I

RE: Simple math: partitioning the time between two DateTimes

2007-08-08 Thread Metz, Bobby
Good info on using a Set. I meant to look at that after looking at the FAQ but wasn't familiar with using them and didn't want to waste too much time. Hiding the rounding error by replacing the last value with $end itself was the solution in my second sub-routine, but it might not have been

RE: Problem with TimeZone.pm

2007-08-30 Thread Metz, Bobby
If you installed the module to your system's default Perl install, it should be found automatically by the use statement. use DateTime; If it's not found, then I'm guessing that you may have more than one Perl install (assuming Unix) and the default Perl install, i.e. the one occurs first in

RE: Problem with TimeZone.pm

2007-08-30 Thread Metz, Bobby
Whoops, spellcheck got me. 'which Perl' should have been 'which perl'. Bobby -Original Message- From: Metz, Bobby [mailto:[EMAIL PROTECTED] Sent: Thursday, August 30, 2007 11:49 AM To: Robert A. Rawlinson; datetime@perl.org Subject: RE: Problem with TimeZone.pm If you installed

RE: Question about printing month/day

2008-05-12 Thread Metz, Bobby
Check out the Basic Usage section of the DateTime FAQ. The How can I get a string representing a date? section likely shows you everything you need. http://datetime.perl.org/index.cgi?FAQBasicUsage Bobby -Original Message- From: Brian Hirt [mailto:[EMAIL PROTECTED] Sent: Thursday, May

RE: definition of correctness

2008-09-29 Thread Metz, Bobby
Don't see this behavior on my system... perl -MPOSIX -le 'print scalar localtime(mktime(0,0,2+24,4,9,108,0,0,-1))' Sun Oct 5 02:00:00 2008 perl -MPOSIX -le 'print scalar localtime(mktime(0,0,2+25,4,9,108,0,0,-1))' Sun Oct 5 03:00:00 2008 I ran all of your examples and the times always agree

RE: difference in absolute days

2008-12-16 Thread Metz, Bobby
I think the key to Perrin's issue is documented on the DateTime page, even though these functions were not referenced in the two posts: + years, months, weeks, days, hours, minutes, seconds, nanoseconds These methods return numbers indicating how many of the given unit the object

RE: Module To Parse Format 'Friday, March 13, 2009 04:20 PM EST'

2009-03-17 Thread Metz, Bobby
Jim, You don't need to write your own module to handle these. Just use the DateTime::Format::Strptime module. Modify the parser example below with a pattern to suit your own format. $dt will hold your new datetime object with the values parsed from your string format. my $parser =

RE: Module To Parse Format 'Friday, March 13, 2009 04:20 PM EST'

2009-03-18 Thread Metz, Bobby
source or storage requirements. Bobby -Original Message- From: Rick Measham [mailto:ri...@isite.net.au] Sent: Tuesday, March 17, 2009 6:34 PM To: jim.mo...@yahoo.com Cc: datetime@perl.org Subject: Re: Module To Parse Format 'Friday, March 13, 2009 04:20 PM EST' Metz, Bobby wrote

RE: Serious Problem - DateTime::Timezone 0.89 when set to Africa / Cairo throws exception right now

2009-04-24 Thread Metz, Bobby
Zefram wrote: Shane McCarron wrote: Wow - sounds like a bug to me. Ick. A bug in what, though? DateTime-today is documented to behave like a truncate-to-day operation, which implies setting to 00:00 local time. Do you want to change the semantics of truncate? Or make -today

RE: DateTime::Format::Strptime fails test

2009-07-13 Thread Metz, Bobby
Dave, I'm not sure I understood your last post. Did you mean that those strftime methods only found in DateTime::Locale::Base are going away? Or did you mean that strftime methods in DateTime proper are being deprecated and removed? If yes to the later, is DateTime::Format::Strptime

RE: DateTime::Format::Strptime fails test

2009-07-13 Thread Metz, Bobby
All, I'm sorry all to reply to my own post. I should have read the original message first before replying to Dave's message. I see that the module I'm questioning is at the root of the issue, so my apologies again. As someone who uses DateTime::Format::Strptime quite a bit,

RE: Inconsistent bug with delta_ms, add, and time zones

2009-11-03 Thread Metz, Bobby
Ronald, Do you run the script via cron? If so, do you only see the timezone error when running it via cron and not when running manually? If yes to both, then I'd wager the routine you referenced is impacted by the shell path not being the same for cron as for your login session. I

RE: Inconsistent bug with delta_ms, add, and time zones

2009-11-03 Thread Metz, Bobby
Ugh, I need more caffeine today it seems. Ignore my idiotic path comment. Question of cron vs. non-cron still applies though? If nothing else but to narrow the conditions under which your issue is occurring. Bobby -Original Message- From: Metz, Bobby Sent: Tuesday, November 03

RE: time_zone and DateTime::Format::Strptime

2009-12-15 Thread Metz, Bobby
I like the new option idea Kevin proposes. Seems more straightforward. Just my 2 cents... B -Original Message- From: Kevin McGrath [mailto:kmcgr...@baknet.com] Sent: Tuesday, December 15, 2009 2:23 PM To: Evan Carroll Cc: datetime@perl.org Subject: Re: time_zone and

RE: DateTime::Duration - Multiplication with a number less than one not working correctly

2010-08-23 Thread Metz, Bobby
-Original Message- From: Karen Etheridge [mailto:p...@froods.org] Sent: Monday, August 23, 2010 1:42 PM Totally off-topic, but this reminded me of a book I recently completed, Martian Rainbow by Robert L. Forward, which spelled out the details of a functional Martian calendar that

RE: DateTime::Format::Strptime bug report

2010-09-02 Thread Metz, Bobby
You can add the current year to your string value prior to parsing. my $val = Sep 1 05:39:02; # Grab the year either via exec or via DateTime, your choice chomp(my $year = `date '+%Y'`); # --or-- my $year = strftime('%Y',localtime(time)); # Then combine and parse the string value into a DT

RE: DateTime::Format::Strptime bug report

2010-09-02 Thread Metz, Bobby
On Thu, Sep 02, 2010 at 01:24:03PM -0400, Metz, Bobby wrote: You can add the current year to your string value prior to parsing. Thanks. I'll adopt the DateTime based version in your second mail. You're welcome. Of course you could also alter you syslog config to include the year

RE: How to distinguish between no month/day and 01/01?

2011-02-23 Thread Metz, Bobby
Philip, I'm just trying to understand your problem a bit more, so bear with me. First, I think the trouble is that you technically can't have a date without a month and day value, so storing them as undef wouldn't work well, at least not without sacrificing DateTime math and impacting

RE: Issue with finding next DST change, date math error?

2012-05-25 Thread Metz, Bobby
From: Zefram [mailto:zef...@fysh.org] The form of epoch seconds implemented by DateTime doesn't count leap seconds. So in the time scale supplied by DateTime it is *not* I wasn't aware of the bit about epoch Zefram pointed out. Can someone answer this related hypothetical for me? 1. You

RE: Determine size of a DateTime::SpanSet?

2013-09-04 Thread Metz, Bobby
I don't use this module, but check the docs on the as_list() method. The config example (copied below) should give you an idea on how to get the # of objects without the addition of any special methods required. my @dt_span = $set-as_list( span = $span ); Bobby From: Andreas Isberg