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

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: walltime = f( location, utctime) and utctime = f( location, utctime ) These are two different problems, and one is much harder than the other! (though both are ugly!) You probably meant "utctime = f( location, walltime)" in the last equation, but that would still be wrong. A somewhat more correct equation would be utctime = f^(-1)( location, walltime) 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