Thank you Eric and Zefram!
On Sun, Apr 24, 2016 at 10:11 AM, Eric Brine wrote:
> Released DateTimeX::Start to cpan
> http://search.cpan.org/perldoc?DateTimeX::Start
>
> On Sat, Apr 23, 2016 at 5:29 PM, Eric Brine wrote:
>
>> Thanks! Yeah, knowing
Released DateTimeX::Start to cpan
http://search.cpan.org/perldoc?DateTimeX::Start
On Sat, Apr 23, 2016 at 5:29 PM, Eric Brine wrote:
> Thanks! Yeah, knowing that, I can easily make my code only consider
> minutes. I'll also incorporate your "rd" optimziation
>
> On Sat, Apr
Thanks! Yeah, knowing that, I can easily make my code only consider
minutes. I'll also incorporate your "rd" optimziation
On Sat, Apr 23, 2016 at 5:16 PM, Zefram wrote:
> Eric Brine wrote:
> >Thanks. I'll study this. I didn't think dividing by 60, adding 60 and
> >subtracting
Eric Brine wrote:
>Thanks. I'll study this. I didn't think dividing by 60, adding 60 and
>subtracting 60 was safe before of leap seconds.
POSIX time, what DateTime calls "epoch" time, doesn't count leap seconds.
Each multiple of 60 corresponds to the top of a UTC minute.
-zefram
On Sat, Apr 23, 2016 at 4:56 PM, Zefram wrote:
> Eric Brine wrote:
> >The binary search found:
> ...
> >2013-11-03T03:45:00 UTC
> >2013-11-03T04:07:30 UTC
>
> You should only examine integral minutes. Truncate to the minute
> when bisecting, before you pass your bisected time
Eric Brine wrote:
>The binary search found:
...
>2013-11-03T03:45:00 UTC
>2013-11-03T04:07:30 UTC
You should only examine integral minutes. Truncate to the minute
when bisecting, before you pass your bisected time to DateTime. Or,
to avoid fractions entirely, extend the search radius to 2048
Then I don't understand your algorithm. I perform a binary search on epoch
times with two UTC dt as bounds. The result is 2013-11-02T23:59:03 in the
desired time zone.
On Sat, Apr 23, 2016 at 4:08 PM, Zefram wrote:
> Eric Brine wrote:
> >00:00:04 <--- Starting from this
>
>
Eric Brine wrote:
>00:00:04 <--- Starting from this
You shouldn't be getting such a time at any point in the algorithm I
was proposing.
-zefram
On Sat, Apr 23, 2016 at 3:52 PM, Zefram wrote:
> Eric Brine wrote:
> >I can't figure out how to search only down to the minute without causing
> it
> >to find the wrong answer on days with two midnights.
>
> In those fairly common cases, where DST ending causes time to jump back
Eric Brine wrote:
>I can't figure out how to search only down to the minute without causing it
>to find the wrong answer on days with two midnights.
In those fairly common cases, where DST ending causes time to jump back
from 01:00 to 00:00, you want to consistently get the earlier midnight.
This
On Sat, Apr 23, 2016 at 3:42 PM, Eric Brine wrote:
> On Fri, Apr 22, 2016 at 8:04 PM, Zefram wrote:
>
>> 18 steps
>> of binary search gets you down to the second, but actually modern zones
>> are always on integral-minute offsets, so you could look only at
On Fri, Apr 22, 2016 at 8:04 PM, Zefram wrote:
> 18 steps
> of binary search gets you down to the second, but actually modern zones
> are always on integral-minute offsets, so you could look only at integral
> minutes and take only 12 steps. For each UT time you try, convert it
On Sat, Apr 23, 2016 at 2:58 PM, Eric Brine wrote:
> On Sat, Apr 23, 2016 at 2:57 PM, Eric Brine wrote:
>
>> Zephram, could you verify the updated code:
>>
>> http://stackoverflow.com/a/21000824/589924
>>
>> Assumptions:
>>
>>
>>- There is no dt to
On Sat, Apr 23, 2016 at 2:57 PM, Eric Brine wrote:
> Zephram, could you verify the updated code:
>
> http://stackoverflow.com/a/21000824/589924
>
> Assumptions:
>
>
>- There is no dt to which one can add time to obtain a dt with an
>earlier date.
>- In no time
Zephram, could you verify the updated code:
http://stackoverflow.com/a/21000824/589924
Assumptions:
- There is no dt to which one can add time to obtain a dt with an
earlier date.
- In no time zone does a date starts more than 48*60*60 seconds before
the date starts in UTC.
- In
Bill Moseley wrote:
>The code Eric pointed me to sets the hour to 12 on a floating $dt and then
>sets the timezone. Sounds like there's cases where that could still fail.
Right, that's broken. That's not the algorithm I was proposing.
You should search among *UT* times, and the only kind of
On Sat, Apr 23, 2016 at 10:14 AM, Zefram wrote:
> Bill Moseley wrote:
> >hour=> 12, # Assume this exists
>
> This does not always exist. Africa/Khartoum on 2000-01-15, for example.
> In fact, thanks to cases such as Pacific/Apia on 2011-12-30, not only is
> there no
Bill Moseley wrote:
>hour=> 12, # Assume this exists
This does not always exist. Africa/Khartoum on 2000-01-15, for example.
In fact, thanks to cases such as Pacific/Apia on 2011-12-30, not only is
there no hour that exists on every day in every zone, there are actually
some zone days
On Fri, Apr 22, 2016 at 8:04 PM, Zefram wrote:
> Bill Moseley wrote:
> >In other words, I'm trying to find the start and end times for the current
> >month based on a given timezone and then use those in my database query.
>
> You can perform a binary search on UT times, looking
Thanks -- that makes sense. My error not considering that 00:00:00 might
not exist on the first of the month.
Suggestion how best to do this?
I'm running queries where I want to fetch rows with a timestamp within a
given month -- but that time range should be in the time zone of the user
I'm
Bill Moseley wrote:
>Why can't I truncate to the month?
Because 2016-04-01T00:00:00 didn't exist in Asia/Amman. Its DST rules
include a switch from winter time to summer time at 24:00 on the last
Thursday in March. This has the effect of skipping the hour from 00:00
to 01:00 on some Friday
21 matches
Mail list logo