a day has only 24 1 hours
play

A Day Has Only 241 Hours Miroslav ediv eumiro 1 / 73 A Day Has - PowerPoint PPT Presentation

A Day Has Only 241 Hours Miroslav ediv eumiro 1 / 73 A Day Has Only 241 Hours eumiro soluteTech 2 / 73 A Day Has Only 241 Hours check the time eumiro soluteTech 3 / 73 A Day Has Only 241 Hours check the time


  1. A Day Has Only 24±1 Hours Miroslav Š edivý  eumiro 1 / 73

  2. A Day Has Only 24±1 Hours  eumiro  soluteTech 2 / 73

  3. A Day Has Only 24±1 Hours check the time  eumiro  soluteTech 3 / 73

  4. A Day Has Only 24±1 Hours check the time don't check the time too often  eumiro  soluteTech 4 / 73

  5. A Day Has Only 24±1 Hours check the time don't check the time too often check what your government does  eumiro  soluteTech 5 / 73

  6. Miroslav Š edivý [ ˈ m ɪ r ɔ sla ʋ ˈʃɛɟɪ vi ː ]  eumiro  soluteTech 6 / 73

  7. Miroslav Š edivý [ ˈ m ɪ r ɔ sla ʋ ˈʃɛɟɪ vi ː ] born in Bratislava, Czechoslovakia ( TZ=Europe/Bratislava )  eumiro  soluteTech 7 / 73

  8. Miroslav Š edivý [ ˈ m ɪ r ɔ sla ʋ ˈʃɛɟɪ vi ː ] born in Bratislava, Czechoslovakia ( TZ=Europe/Bratislava ) M.Sc. at INSA Lyon, France ( TZ=Europe/Paris )  eumiro  soluteTech 8 / 73

  9. Miroslav Š edivý [ ˈ m ɪ r ɔ sla ʋ ˈʃɛɟɪ vi ː ] born in Bratislava, Czechoslovakia ( TZ=Europe/Bratislava ) M.Sc. at INSA Lyon, France ( TZ=Europe/Paris ) Senior Software Developer at solute GmbH, Karlsruhe, Germany ( TZ=Europe/Berlin )  eumiro  soluteTech 9 / 73

  10. Miroslav Š edivý [ ˈ m ɪ r ɔ sla ʋ ˈʃɛɟɪ vi ː ] born in Bratislava, Czechoslovakia ( TZ=Europe/Bratislava ) M.Sc. at INSA Lyon, France ( TZ=Europe/Paris ) Senior Software Developer at solute GmbH, Karlsruhe, Germany ( TZ=Europe/Berlin ) The whole life in the CE(S)T!  eumiro  soluteTech 10 / 73

  11.  eumiro  soluteTech 11 / 73

  12. Thursday, 11th July 2019 10:33 CEST (Basel, Switzerland)  eumiro  soluteTech 12 / 73

  13. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0)  eumiro  soluteTech 13 / 73

  14. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0) datetime.datetime(2019, 7, 11, 8, 33, 0, 0) # server set to UTC  eumiro  soluteTech 14 / 73

  15. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0) datetime.datetime(2019, 7, 11, 8, 33, 0, 0) # server set to UTC >>> datetime.datetime.utcnow() datetime.datetime(2019, 7, 11, 8, 33, 0, 0)  eumiro  soluteTech 15 / 73

  16. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0) datetime.datetime(2019, 7, 11, 8, 33, 0, 0) # server set to UTC >>> datetime.datetime.utcnow() datetime.datetime(2019, 7, 11, 8, 33, 0, 0) >>> datetime.datetime.now(datetime.timezone.utc) datetime.datetime(2019, 7, 11, 8, 33, 0, 0, tzinfo=datetime.timezone.utc)  eumiro  soluteTech 16 / 73

  17. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0) datetime.datetime(2019, 7, 11, 8, 33, 0, 0) # server set to UTC >>> datetime.datetime.utcnow() datetime.datetime(2019, 7, 11, 8, 33, 0, 0) >>> datetime.datetime.now(datetime.timezone.utc) datetime.datetime(2019, 7, 11, 8, 33, 0, 0, tzinfo=datetime.timezone.utc) >>> datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=2))) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(0, 7200)))  eumiro  soluteTech 17 / 73

  18. >>> import datetime >>> datetime.datetime.now() datetime.datetime(2019, 7, 11, 10, 33, 0, 0) datetime.datetime(2019, 7, 11, 8, 33, 0, 0) # server set to UTC >>> datetime.datetime.utcnow() datetime.datetime(2019, 7, 11, 8, 33, 0, 0) >>> datetime.datetime.now(datetime.timezone.utc) datetime.datetime(2019, 7, 11, 8, 33, 0, 0, tzinfo=datetime.timezone.utc) >>> datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=2))) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(0, 7200))) >>> import pytz >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>)  eumiro  soluteTech 18 / 73

  19. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>)  eumiro  soluteTech 19 / 73

  20. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> datetime.datetime(2019, 7, 11, 10, 33, 0, 0, pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' LMT+0:34:00 STD>)  eumiro  soluteTech 20 / 73

  21. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> datetime.datetime(2019, 7, 11, 10, 33, 0, 0, pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' LMT+0:34:00 STD>) >>> pytz.timezone('Europe/Zurich').localize(datetime.datetime(2019, 7, 11, 10, 33, 0, 0)) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>)  eumiro  soluteTech 21 / 73

  22. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> datetime.datetime(2019, 7, 11, 10, 33, 0, 0, pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' LMT+0:34:00 STD>) >>> pytz.timezone('Europe/Zurich').localize(datetime.datetime(2019, 7, 11, 10, 33, 0, 0)) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> now + datetime.timedelta(days=184) datetime.datetime(2020, 1, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>)  eumiro  soluteTech 22 / 73

  23. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> datetime.datetime(2019, 7, 11, 10, 33, 0, 0, pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' LMT+0:34:00 STD>) >>> pytz.timezone('Europe/Zurich').localize(datetime.datetime(2019, 7, 11, 10, 33, 0, 0)) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> now + datetime.timedelta(days=184) datetime.datetime(2020, 1, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> pytz.timezone('Europe/Zurich').normalize(now + datetime.timedelta(days=184)) datetime.datetime(2020, 1, 11, 9, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CET+1:00:00 STD>)  eumiro  soluteTech 23 / 73

  24. >>> datetime.datetime.now(pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, 0, 0, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> datetime.datetime(2019, 7, 11, 10, 33, 0, 0, pytz.timezone('Europe/Zurich')) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' LMT+0:34:00 STD>) >>> pytz.timezone('Europe/Zurich').localize(datetime.datetime(2019, 7, 11, 10, 33, 0, 0)) datetime.datetime(2019, 7, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> now + datetime.timedelta(days=184) datetime.datetime(2020, 1, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CEST+2:00:00 DST>) >>> pytz.timezone('Europe/Zurich').normalize(now + datetime.timedelta(days=184)) datetime.datetime(2020, 1, 11, 9, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CET+1:00:00 STD>) >>> pytz.timezone('Europe/Zurich').localize(now.replace(tzinfo=None) + datetime.timedelta(days=184)) datetime.datetime(2020, 1, 11, 10, 33, tzinfo=<DstTzInfo 'Europe/Zurich' CET+1:00:00 STD>)  eumiro  soluteTech 24 / 73

  25. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d') >>> weekday = datetime.datetime.utcnow().strftime('%A') '2019-07-11' 'Thursday'  eumiro  soluteTech 25 / 73

  26. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d') >>> weekday = datetime.datetime.utcnow().strftime('%A') '2019-07-11' 'Thursday' >>> now = datetime.datetime.utcnow() >>> date = now.strftime('%Y-%m-%d') >>> weekday = now.strftime('%A')  eumiro  soluteTech 26 / 73

  27. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d') >>> weekday = datetime.datetime.utcnow().strftime('%A') '2019-07-11' 'Thursday' >>> now = datetime.datetime.utcnow() >>> date = now.strftime('%Y-%m-%d') >>> weekday = now.strftime('%A') Check the time only once!  eumiro  soluteTech 27 / 73

  28. >>> start = datetime.datetime.utcnow() # datetime.datetime(2019, 7, 11, 8, 33, 0, 0) >>> expensive_operation() >>> end = datetime.datetime.utcnow() # datetime.datetime(2019, 7, 11, 8, 33, 1, 0) >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.0  eumiro  soluteTech 28 / 73

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend