{"id":264,"date":"2013-09-25T13:25:47","date_gmt":"2013-09-25T18:25:47","guid":{"rendered":"http:\/\/thenoyes.com\/littlenoise\/?p=264"},"modified":"2013-09-25T13:29:10","modified_gmt":"2013-09-25T18:29:10","slug":"pre-5-0-30-addtime","status":"publish","type":"post","link":"https:\/\/thenoyes.com\/littlenoise\/?p=264","title":{"rendered":"Pre-5.0.30 ADDTIME()"},"content":{"rendered":"<p>For when you want to add times greater than 839 hours.<\/p>\n<p>CREATE FUNCTION ADDTIME_OLD(d datetime, t varchar(12))<br \/>\nRETURNS datetime<br \/>\nDETERMINISTIC<br \/>\nRETURN ADDTIME(<br \/>\n  d + INTERVAL SUBSTRING_INDEX(t, &#8216;:&#8217;, 1) HOUR,<br \/>\n  CONCAT(IF(LEFT(t, 1) = &#8216;-&#8216;, &#8216;-&#8216;, &#8221;), &#8217;00:&#8217;, SUBSTRING_INDEX(t, &#8216;:&#8217;, -2))<br \/>\n);<\/p>\n<p>(Almost the same. I&#8217;m not going to figure out how to do the &#8220;you can use any delimiter you want&#8221; that MySQL supports.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For when you want to add times greater than 839 hours. CREATE FUNCTION ADDTIME_OLD(d datetime, t varchar(12)) RETURNS datetime DETERMINISTIC RETURN ADDTIME( d + INTERVAL SUBSTRING_INDEX(t, &#8216;:&#8217;, 1) HOUR, CONCAT(IF(LEFT(t, 1) = &#8216;-&#8216;, &#8216;-&#8216;, &#8221;), &#8217;00:&#8217;, SUBSTRING_INDEX(t, &#8216;:&#8217;, -2)) ); (Almost the same. I&#8217;m not going to figure out how to do the &#8220;you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2IBF1-4g","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264"}],"version-history":[{"count":3,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}