Advertise with us

find the day name and month name from current date

Posted by  Somesh
 2515  View(s)
Ratings:
Rate this:
hi,
How to find the day name and month name from current date ?

thanks
  1. Re: find the day name and month name from current date

    Hi somesh,
    we find the month name and day from current date by using built in function in javascript. check this example

    <script type="text/javascript">
        var monthNames=new Array("January","February","March","April","May","June","July","August",
    "September","October","November","December");
      
     var dayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Wednesday","Thursday","Friday",
    "Saturday");
       
    var InputDate=new Date();
       
    var strDays=dayNames[InputDate.getDay()];  
     var strMonth=monthNames[InputDate.getMonth()];   
    var strYear=InputDate.getYear()+1900;
      
     alert(strDays+", "+strMonth+", "+strYear);
        </script>

      Modified On Mar-29-2018 04:34:04 AM

Answer