From 5382e0a287ffd889699354237c525c9ecfe3e863 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 30 Oct 2021 22:51:43 +0200 Subject: [PATCH 1/2] Fix issue #12 Fixes #12 --- README.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index a7e0316..8333d45 100644 --- a/README.rst +++ b/README.rst @@ -62,7 +62,7 @@ Usage Example # Example of working with a `datetime` object # from https://docs.python.org/3/library/datetime.html#examples-of-usage-datetime - from adafruit_datetime import datetime, date, time, timezone + from adafruit_datetime import datetime, date, time # Using datetime.combine() d = date(2005, 7, 14) @@ -72,7 +72,6 @@ Usage Example # Using datetime.now() print("Current time (GMT +1):", datetime.now()) - print("Current UTC time: ", datetime.now(timezone.utc)) # Using datetime.timetuple() to get tuple of all attributes dt = datetime(2006, 11, 21, 16, 30) @@ -80,12 +79,13 @@ Usage Example for it in tt: print(it) - # Formatting a datetime - print( - "The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.".format( - dt, "day", "month", "time" - ) - ) + print("Today is: ", dt.ctime()) + + iso_date_string = "2020-04-05T05:04:45.752301" + print("Creating new datetime from ISO Date:", iso_date_string) + isodate = datetime.fromisoformat(iso_date_string) + print("Formatted back out as ISO Date: ", isodate.isoformat()) + Documentation ============= @@ -115,3 +115,4 @@ Copyright (c) 2000 BeOpen.com. All rights reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All rights reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. + From 42c02c8cd8c334e9cba8100f594e952c0170d5bd Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 30 Oct 2021 17:39:00 -0400 Subject: [PATCH 2/2] remove whitespace --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index 8333d45..b1c0837 100644 --- a/README.rst +++ b/README.rst @@ -115,4 +115,3 @@ Copyright (c) 2000 BeOpen.com. All rights reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All rights reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. -