{"id":2479,"date":"2017-05-01T00:01:24","date_gmt":"2017-05-01T07:01:24","guid":{"rendered":"http:\/\/c-for-dummies.com\/blog\/?p=2479"},"modified":"2017-05-08T07:42:39","modified_gmt":"2017-05-08T14:42:39","slug":"day-of-the-year-calculation","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=2479","title":{"rendered":"Day-of-the-Year Calculation"},"content":{"rendered":"<p>Today is May 1<sup>st<\/sup>. It&#8217;s the 121<sup>st<\/sup> day of the year 2017. In 2016, May 1 was the 122<sup>nd<\/sup> day of the year, because 2016 was a leap year. You can look up this information on a calendar or, more disappointingly, use Google. You can also write code that does the calculation for you, which is this month&#8217;s Exercise.<br \/>\n<!--more--><br \/>\nHere&#8217;s the task: Given a random value from 1 to 365, which represents a day of the year 2017, what is the specific month and day for that value?<\/p>\n<p>So the value 1 would be January 1, 2017. And the value 365 would be December 31, 2017. If the computer generates the value 211, what month and day would that be?<\/p>\n<p>Don&#8217;t do the math in your head! Write code!<\/p>\n<p>I&#8217;ll post <a href=\"http:\/\/c-for-dummies.com\/blog\/?p=2493\">my solution<\/a> in a week.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given a value from 1 to 365, calculate the month and day of the year. <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=2479\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2479","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2479"}],"version-history":[{"count":5,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2479\/revisions"}],"predecessor-version":[{"id":2512,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2479\/revisions\/2512"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}