[Python-Dev] Aware datetime from naive local time Was: Status on PEP-431 Timezones

MRAB python at mrabarnett.plus.com
Mon Apr 13 22:10:22 CEST 2015


On 2015-04-13 20:14, Alexander Belopolsky wrote:
>
> On Mon, Apr 13, 2015 at 2:05 PM, Chris Barker <chris.barker at noaa.gov
> <mailto:chris.barker at noaa.gov>> wrote:
>
>         However, different UTC times may map to the same wall time and
>         some expressible wall times are not results of a map of any UTC
>         time.
>
>
>     got it. I suggest you perhaps word it something like:
>
>     wall_time = f( location, utc_time)
>
>     and
>
>     utc_time = f( location, utc_time )
>
>     These are two different problems, and one is much harder than the
>     other! (though both are ugly!)
>
>
> You probably meant "utc_time = f( location, wall_time)" in the last
> equation, but that would still be wrong.
> A somewhat more correct equation would be
>
> utc_time = f^(-1)( location, wall_time)
>
> where f^(-1) is the inverse function of f, but since f in not monotonic,
> no such inverse exists.
>
Don't you mean "f⁻¹"? :-)

> Finding the inverse of f is the same as solving the equation f(x) = y
> for any given y.  If f is such that this
> equation has only one solution for all possible values of y then an
> inverse exists, but this
> is not so in our case.
>



More information about the Python-Dev mailing list