{"id":184,"date":"2004-03-25T12:45:28","date_gmt":"2004-03-25T16:45:28","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=184"},"modified":"2004-03-25T12:45:28","modified_gmt":"2004-03-25T16:45:28","slug":"sometimes-you-just-have-to","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2004\/03\/25\/sometimes-you-just-have-to\/","title":{"rendered":"sometimes you just have to &#8230;"},"content":{"rendered":"<p>&hellip;&nbsp;calculate the number of seconds in the current year using JavaScript:<\/p>\n<pre>\nfunction seconds_in_this_year() {\n      \/\/ get length of this year by subtracting \"Jan 1st, \/This Year\/\"\n      \/\/ from  \"Jan 1st, \/Next Year\/\"\n      var now = new Date();\n      var current_year = now.getFullYear();\n      var jan_first = new Date(current_year, 0, 1, 0, 0, 0, 0);\n      var jan_next = new Date(current_year + 1, 0, 1, 0, 0, 0, 0);\n      return (jan_next.getTime() - jan_first.getTime()) \/ 1000;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&hellip;&nbsp;calculate the number of seconds in the current year using JavaScript: function seconds_in_this_year() { \/\/ get length of this year by subtracting &#8220;Jan 1st, \/This Year\/&#8221; \/\/ from &#8220;Jan 1st, \/Next Year\/&#8221; var now = new Date(); var current_year = now.getFullYear(); var jan_first = new Date(current_year, 0, 1, 0, 0, 0, 0); var jan_next = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,1],"tags":[1739,1741,1740],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-computers-suck","category-general","tag-data","tag-javascript","tag-seconds"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-2Y","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":0,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}