On 7 Dez., 16:21, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Dec 7, 7:20�am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > >> Hello, > > >> From a zone-file of a Microsoft Active Directory integrated DNS server > >> I get the date/time of the dynamic update entries in a format, which > >> is as far as I know the hours since january 1st 1901. > > If it *is* then the easiest way is this: > > <code> > import datetime > print datetime.date (1901, 1, 1) + datetime.timedelta (hours=3566839) > > </code> > > But, as someone pointed out, that puts you somewhere in 2300. > Where are you getting the 1901 from (and the hours, for that > matter). If it's based, as AD dates are, for example, from 1601, > then the calc becomes: > > <code> > import datetime > print datetime.date (1601, 1, 1) + datetime.timedelta (hours=3566839) > > </code> > > which looks more realistic. But frankly I'm guessing. > > TJG
(3566839/24)/365 = 407 - YES I did this calculation too and was surprised. But if you try this out in MS Excel: ="01.01.1901"+(A1/24-(REST(A1;24)/24))+ZEIT(REST(A1;24);0;0) (put 3566839 in field A1 and switch the format of the result-fieldby right- click on it to the date format "14.3.01 13:30") and then replace 3566839 by, let's say, "2", Excel calculates the date 01.10.1901 2:00 AM. Try out other values like 5 or 24! So I thought 3566839 represents hours. Dirk -- http://mail.python.org/mailman/listinfo/python-list