Midwest Dev Chat

MidwestDevChat.com github.com/skidvis/Midwest-Dev-Chat

  • The newest 15 messages in the super-cool #python channel.

  • 08/15 17:04:53 Candra: this seems to work

  • 08/15 17:04:56 Candra: content_updated_on = datetime.strptime(

  • 08/15 17:04:56 Candra: ET.fromstring(r.text).find('.//prop[@name="content_updated_on"]').attrib['value'],

  • 08/15 17:04:59 Candra: '%Y-%m-%dT%H:%M:%S'

  • 08/15 17:05:02 Candra: )

  • 08/15 17:05:04 Candra: updated_on = datetime.strptime(

  • 08/15 17:05:07 Candra: ET.fromstring(r.text).find('.//prop[@name="updated_on"]').attrib['value'],

  • 08/15 17:05:10 Candra: '%Y-%m-%dT%H:%M:%S'

  • 08/15 17:05:12 Candra: )

  • 08/15 17:05:15 Candra: assert content_updated_on - updated_on <= timedelta(seconds=5), \

  • 08/15 17:05:18 Candra: 'content_updated_on should be equal to updated_on: {}'.format(

  • 08/15 17:05:21 Candra: r.text

  • 08/15 17:16:29 Candra: )/win 12

  • 08/16 07:59:40 Eliz: `assert content_updated_on - updated_on <= timedelta(seconds=5)` seems like a fine approach.

  • 08/16 11:06:42 Ryan: As a general thing, dateutil https://dateutil.readthedocs.io/en/stable/ is a very handy thing sometimes. It has a nice parser that will figure out dates for you, relativedelta (“somedate + 2 days + 1 hour” ), and rrule to generate sets of dates based upon rules. You don’t need if for your example but it has saved me much weeping and gnashing of teeth over the years.

  • *Usernames have been changed to protect the innocent.

Check out all the cool channels!

Join the conversation!