{"id":12424,"date":"2021-12-09T03:25:57","date_gmt":"2021-12-09T03:25:57","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=12424"},"modified":"2021-12-09T03:26:18","modified_gmt":"2021-12-09T03:26:18","slug":"dos-how-to-convert-month-name-as-numbers","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/dos-how-to-convert-month-name-as-numbers\/25850.html","title":{"rendered":"Dos &#8211; How To Convert Month Name As Numbers &#8211;"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I want to capture the current date in the format &#8211; Month-Day-Year (6-29-11).<br \/>\nDate gives output as 29-Jun-11 and I am modifying as below.<\/p>\n<p>set month=%date:~3,3%<br \/>\nset Day=%date:~0,2%<br \/>\nset year=%date:~7,3%<\/p>\n<p>if %month%==Jan set cmonth=1<br \/>\nif %month%==Feb set cmonth=2<br \/>\nif %month%==Mar set cmonth=3<br \/>\nif %month%==Apr set cmonth=4<br \/>\nif %month%==May set cmonth=5<br \/>\nif %month%==Jun set cmonth=6<br \/>\nif %month%==Jul set cmonth=7<br \/>\nif %month%==Aug set cmonth=8<br \/>\nif %month%==Sep set cmonth=9<br \/>\nif %month%==Oct set cmonth=10<br \/>\nif %month%==Nov set cmonth=11<br \/>\nif %month%==Dev set cmonth=12<\/p>\n<p>Is there any way we can convert the months as numbers ??<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":8},"question-category":[55],"question_tags":[],"class_list":["post-12424","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/12424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=12424"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=12424"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=12424"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=12424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}