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 for the boundaries
where the month changes in zone time.  For each month boundary, start
with a range of the UT month boundary plus and minus 24 hours.  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
to zone time and see which month it ends up in.

-zefram

Reply via email to