title: How to print Nepali date today in PHP?
body: <p>i want to echo print nepali calendar date on different date formats.
  please take a look at bellow code</p>
  
  <p>And there is a jquery date picker for this:
  <a href="http://sajanmaharjan.com.np/my-works/nepali-datepicker-ui/" rel="nofollow noreferrer">http://sajanmaharjan.com.np/my-works/nepali-datepicker-ui/</a></p>
  
  <p>Now, all i want is to print 2070-10-21 as today date. (like (date(y-m-d) returns as English date)</p>
  
  <p>What i have tried is this:</p>
  
  <pre><code> &lt;div id="time"&gt;
  
          &lt;!-- PRINTING NEPALI DATE AND TIME --&gt;
  
          &lt;span class="time_date"&gt;
          &lt;?php 
          $timezone = "Asia/Kathmandu";
          if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
          echo date('l F j, Y');?&gt;  &amp;nbsp;| &amp;nbsp; &lt;script type='text/javascript'&gt;var __ndq = __ndq || {format:'W, M D, Y',color:'#555555'};var __sn = document.getElementsByTagName('script'); __sn = __sn[__sn.length-1];(function() {var __nd = document.createElement('script'); __nd.type = 'text/javascript'; __nd.async = true; __nd.src = ('http://') + 'goodies.softnep.com/nepali_date/nep.date.js'; __sn.parentNode.insertBefore(__nd, __sn);})();&lt;/script&gt;&amp;nbsp;|&amp;nbsp; &lt;span id="sn_nepalitime"&gt;&lt;/span&gt;&lt;/span&gt;
          &lt;script type="text/javascript"&gt;
          var currenttime = "&lt;?php echo date('M-d,Y h:i:s');?&gt;"; &lt;!--"November 20, 2013 13:19:32"--&gt;
          var montharray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
          var numbers = Array("&amp;#2406;", "&amp;#2407;", "&amp;#2408;", "&amp;#2409;", "&amp;#2410;", "&amp;#2411;", "&amp;#2412;", "&amp;#2413;", "&amp;#2414;", "&amp;#2415;");
          var serverdate = new Date(currenttime);
          function padlength(what) {
              var output = (what.toString().length == 1) ? "0" + what : what
              return output
          }
          function displaytime() {
              //alert(currenttime);
              serverdate.setSeconds(serverdate.getSeconds() + 1)
              var datestring = montharray[serverdate.getMonth()] + " " + padlength(serverdate.getDate()) + ", " + serverdate.getFullYear()
  
  
              hr=padlength(serverdate.getHours());
              mi=padlength(serverdate.getMinutes()) ;
              se=padlength(serverdate.getSeconds());
              dd="PM";
                 if (hr &gt;= 12) {
                  hr = hr-12;
                  dd = "AM";
              }
              if (hr == 0) {
                  hr = 12;
              }
              var timestring = hr + ":" + mi + ":" + se +" "+ dd;
                  var arr = timestring.split("");
                  for (i = 0; i &lt; (arr.length-3); i++) {
                      if (arr[i] != ":") {
                          arr[i] = numbers[arr[i]];
                      } 
                  }
                  timestring = arr.join("");
          /*        timestring = timestring.replace("AM","gu");       
           timestring = timestring.replace("PM","gu");*/
                  document.getElementById("sn_nepalitime").innerHTML = " " + timestring;
  
              setTimeout('displaytime()',1000);
          }
          displaytime();
          &lt;/script&gt;
  
  
          &lt;!-- END OF NEPALI DATE AND TIME --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This prints : Wednesday February 5, 2014  |   बुधवार, माघ २२, २०७० |  ०७:३६:४५ PM</p>
  
  <p>And i want it to print : 2070-10-22</p>