{"id":226,"date":"2019-02-20T03:11:28","date_gmt":"2019-02-20T03:11:28","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/python\/?p=226"},"modified":"2019-03-02T03:54:38","modified_gmt":"2019-03-02T03:54:38","slug":"14-python-date-and-time-2","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/","title":{"rendered":"Python &#8211; Date and Time 2"},"content":{"rendered":"<p>In this lesson, you will learn how to work with Date, Time and DateTime classes in Python. Also we would learn how to format date and time data.<\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li><a href=\"#t1\">Introduction to Python Date and Time<\/a><\/li>\n<li><a href=\"#t2\">Working with Current Date and Time<\/a><\/li>\n<li><a href=\"#t3\">Getting Day, Month, Year and Weekday<\/a><\/li>\n<li><a href=\"#t4\">Getting both Date and Time<\/a><\/li>\n<li><a href=\"#t5\">Working with only Time<\/a><\/li>\n<li><a href=\"#t6\">Formatting using<em> strftime()<\/em> function<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=cr5HBU-8N2Y&amp;feature=youtu.be\">Watch the Video<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">1. Introduction to Python Date and Time<\/strong><\/h4>\n<p>Python provides a number of module and several functions for working with date and time.<\/p>\n<p>Before you can work with date, time and datetime codes, you need to import the necessary modules. These modules are date, time and datetime. This is shown below.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">from<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">datetime<\/span> <span style=\"color: #008800; font-weight: bold;\">import<\/span> date\r\n<span style=\"color: #008800; font-weight: bold;\">from<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">datetime<\/span> <span style=\"color: #008800; font-weight: bold;\">import<\/span> time\r\n<span style=\"color: #008800; font-weight: bold;\">from<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">datetime<\/span> <span style=\"color: #008800; font-weight: bold;\">import<\/span> datetime\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Working with Current Date and Time<\/strong><\/h4>\n<p>The first thing you want to do with date and time is to get today&#8217;s date. To do that you use the today() function in the date module.<\/p>\n<p>The code below prints out the today&#8217;s date<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">today <span style=\"color: #333333;\">=<\/span> date<span style=\"color: #333333;\">.<\/span>today()\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Today's date is \"<\/span>, today)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>If you run the above code, you will have the output below:<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Today<span style=\"background-color: #fff0f0;\">'s date is  2019-02-20<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Getting Day, Month, Year and Weekday<\/strong><\/h4>\n<p>You will notice that the date is made up of day, month and year. We can therefore separate a date in to the three components. This is done using the day, month and year methods.<\/p>\n<p>The code below prints out the day, month and year in today&#8217;s date.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">today <span style=\"color: #333333;\">=<\/span> date<span style=\"color: #333333;\">.<\/span>today()\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Today's date is \"<\/span>, today)\r\n\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Day: \"<\/span>, today<span style=\"color: #333333;\">.<\/span>day)\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Month: \"<\/span>, today<span style=\"color: #333333;\">.<\/span>month)\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Year: \"<\/span>, today<span style=\"color: #333333;\">.<\/span>year)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Run this code and examine the output<\/p>\n<p>You can also get the weekday using the <strong><em>today.weekday()<\/em><\/strong> function. If you use this function, you get the weekday&#8217;s number. This is such that Monday = 0, Tuesday = 1, Wednesday = 3, and so on. You can try this yourself.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t4\">4. Getting both Date and Time<\/strong><\/h4>\n<p>The two functions that gives you both date and time together are the <em>today()<\/em> and the <em>now()<\/em> functions. You use them to create datetime objects. These function however, are in the datetime module.<\/p>\n<p>The datetime object includes hours, minutes, seconds and microseconds.<\/p>\n<p>The code below prints a datetime object representing the current date and time.<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">today <span style=\"color: #333333;\">=<\/span> datetime<span style=\"color: #333333;\">.<\/span>today()\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Today's date is \"<\/span>, today)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>If you execute this code, the output would be as shown below. You can also get the same output using the\u00a0<em>datetime.now()<\/em>\u00a0function.<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Today<span style=\"background-color: #fff0f0;\">'s date is  2019-02-20 03:10:58.165653<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t5\">5. Working with Only Time<\/strong><\/h4>\n<p>To get only the time you need to use the time function. This function takes an argument of a datetime object from the datetime module.<\/p>\n<p>For example, the code below outputs only the current time<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># Getting the current time<\/span>\r\ntoday <span style=\"color: #333333;\">=<\/span> datetime<span style=\"color: #333333;\">.<\/span>now()\r\ncurrenttime <span style=\"color: #333333;\">=<\/span> datetime<span style=\"color: #333333;\">.<\/span>time(datetime<span style=\"color: #333333;\">.<\/span>today())\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"The Current time is: \"<\/span>, currenttime)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>The output of this code is the current time. Now we would write a code that separates the time into hours, minutes, seconds and microseconds. You can find the code below:<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># Getting hours, minutes and seconds<\/span>\r\ntoday <span style=\"color: #333333;\">=<\/span> datetime<span style=\"color: #333333;\">.<\/span>now()\r\ncurrenttime <span style=\"color: #333333;\">=<\/span> datetime<span style=\"color: #333333;\">.<\/span>time(datetime<span style=\"color: #333333;\">.<\/span>today())\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"The Current time is: \"<\/span>, currenttime)\r\n\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Hours \"<\/span>, currenttime<span style=\"color: #333333;\">.<\/span>hour)\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Minutes \"<\/span>, currenttime<span style=\"color: #333333;\">.<\/span>minute)\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Seconds \"<\/span>, currenttime<span style=\"color: #333333;\">.<\/span>second)\r\n<span style=\"color: #007020;\">print<\/span>(<span style=\"background-color: #fff0f0;\">\"Microseconds\"<\/span>, currenttime<span style=\"color: #333333;\">.<\/span>microsecond)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>The output of the code is given below<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">The Current time <span style=\"color: #000000; font-weight: bold;\">is<\/span>:  <span style=\"color: #0000dd; font-weight: bold;\">03<\/span>:<span style=\"color: #0000dd; font-weight: bold;\">36<\/span>:<span style=\"color: #6600ee; font-weight: bold;\">17.469424<\/span>\r\nHours  <span style=\"color: #0000dd; font-weight: bold;\">3<\/span>\r\nMinutes  <span style=\"color: #0000dd; font-weight: bold;\">36<\/span>\r\nSeconds  <span style=\"color: #0000dd; font-weight: bold;\">17<\/span>\r\nMicroseconds <span style=\"color: #0000dd; font-weight: bold;\">469424<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t6\">6. Formatting Date and Time using strftime()<\/strong><\/h4>\n<p>The strftime() is a method that applies to both date and time. It take various format parameters to format the date\/time objects.<\/p>\n<p>For example, the code below displays the current date and time in 24hour format. It also displays the weekday.<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007020;\">print<\/span>(datetime<span style=\"color: #333333;\">.<\/span>now()<span style=\"color: #333333;\">.<\/span>strftime(<span style=\"background-color: #fff0f0;\">\"%A %b %d %Y by %I:%M %p\"<\/span>))\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Find a <a href=\"http:\/\/strftime.org\/\">complete list of strftime() function formats here.<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/cr5HBU-8N2Y\" width=\"100%\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson, you will learn how to work with Date, Time and DateTime classes in Python. Also we would learn how to format date &hellip; <\/p>\n","protected":false},"author":395,"featured_media":227,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[12,20],"class_list":["post-226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorials","tag-python-date-and-time","tag-strftime"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python - Date and Time 2 - Python Tutorials<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python - Date and Time 2 - Python Tutorials\" \/>\n<meta property=\"og:description\" content=\"In this lesson, you will learn how to work with Date, Time and DateTime classes in Python. Also we would learn how to format date &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-20T03:11:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-02T03:54:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"574\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"headline\":\"Python &#8211; Date and Time 2\",\"datePublished\":\"2019-02-20T03:11:28+00:00\",\"dateModified\":\"2019-03-02T03:54:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/\"},\"wordCount\":512,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/Date-and-Time-in-Python-Part-2.jpg\",\"keywords\":[\"Python - Date and Time\",\"strftime()\"],\"articleSection\":[\"Python Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/\",\"name\":\"Python - Date and Time 2 - Python Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/Date-and-Time-in-Python-Part-2.jpg\",\"datePublished\":\"2019-02-20T03:11:28+00:00\",\"dateModified\":\"2019-03-02T03:54:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/Date-and-Time-in-Python-Part-2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/Date-and-Time-in-Python-Part-2.jpg\",\"width\":1024,\"height\":574},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/14-python-date-and-time-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python &#8211; Date and Time 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/\",\"name\":\"Python Tutorials\",\"description\":\"Python Tutorial for Programming and Data Science\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/author\\\/kindsonthegenius-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python - Date and Time 2 - Python Tutorials","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/","og_locale":"en_US","og_type":"article","og_title":"Python - Date and Time 2 - Python Tutorials","og_description":"In this lesson, you will learn how to work with Date, Time and DateTime classes in Python. Also we would learn how to format date &hellip;","og_url":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/","og_site_name":"Python Tutorials","article_published_time":"2019-02-20T03:11:28+00:00","article_modified_time":"2019-03-02T03:54:38+00:00","og_image":[{"width":1024,"height":574,"url":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"headline":"Python &#8211; Date and Time 2","datePublished":"2019-02-20T03:11:28+00:00","dateModified":"2019-03-02T03:54:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/"},"wordCount":512,"commentCount":0,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg","keywords":["Python - Date and Time","strftime()"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/","url":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/","name":"Python - Date and Time 2 - Python Tutorials","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg","datePublished":"2019-02-20T03:11:28+00:00","dateModified":"2019-03-02T03:54:38+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/Date-and-Time-in-Python-Part-2.jpg","width":1024,"height":574},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/python\/14-python-date-and-time-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/python\/"},{"@type":"ListItem","position":2,"name":"Python &#8211; Date and Time 2"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/python\/#website","url":"https:\/\/www.kindsonthegenius.com\/python\/","name":"Python Tutorials","description":"Python Tutorial for Programming and Data Science","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/python\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/python\/author\/kindsonthegenius-2\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/users\/395"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":4,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":231,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/226\/revisions\/231"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media\/227"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}