Code Posts

  • Attribute Error: ‘type’ object has no attribute ‘datetime’

    November 19, 2020 by

    While trying to write some test for NTP servers, my response time used this:I am using IronPython 2.7. timetoreturn = time.time()            if(self.response_time != 0):                 timetoreturn = (self.response_time – datetime.datetime(1970,1,1)).total_seconds() I got this error: Attribute Error: ‘type’ object has no attribute ‘datetime’. My imports were:import datetimefrom datetime import datetime, tzinfo Come to find out, using import datetime just causes problems so I removed that. That… Read more

View all posts

Want more tips?

Have it sent directly to your inbox.