Re: psycopg2: parsing timestamps with odd time zones

Federico Di Gregorio <fog-NGVKUo/i/[email protected]> Wed, 19 May 2010 22:06:30 +0200
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============4518279390273062967==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig63E25744B458ABBDB8B897DD"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig63E25744B458ABBDB8B897DD
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 19/05/2010 22:02, Karsten Hilbert wrote:
[zuper-znip]
>> > So: why don't we do the error in first place, by rounding to the
>> > nearest minute in typecast_PYDATETIME_cast,
> Well, as you say below this would introduce a *silent* error
> and that's why I too great pains to make the application of
> the custom typecaster so extremely narrow.
>=20
>> > instead of in testing? I'd like to do the best thing, but if pytz
>> > doesn't use seconds in the tz either, I guess we can't do more. We
>> > could round instead of truncate, so the error would be +/- 30 secs
>> > instead of 60 and we'd be consistent with pytz.
> Makes sense.

I never investigated this issue very much, just accepted the patches.
Sincerely I'd better like to introduce a trascurable error (< 1m),
document it and send TSTZ_W_SECS to the grave. For all practical
purpouses it is a negligible error and if a user NEEDS such precision
she can write her own typecaster.

federico

--=20
Federico Di Gregorio    <mailto:fog-NGVKUo/i/[email protected]> <jid:[email protected]>
DISCLAIMER. If I receive a message from you, you are agreeing that:
 1. I am by definition, "the intended recipient".
 2. All information in the email is mine to do with as I see fit and
 make such financial profit, political mileage, or good joke as it lends
 itself to. In particular, I may quote it on USENET or the WWW.
 3. I may take the contents as representing the views of your company.
 4. This overrides any disclaimer or statement of confidentiality that
 may be included on your message.


--------------enig63E25744B458ABBDB8B897DD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkv0RM0ACgkQvcCgrgZGjeuW2QCfRJwG7fypXZ+OLWd9xLuYKw30
Uj4AoMWv4WDrXjxiLFNNIhL1EsVDs+4k
=nFs+
-----END PGP SIGNATURE-----

--------------enig63E25744B458ABBDB8B897DD--

--===============4518279390273062967==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg

--===============4518279390273062967==--