FIND THE DAY NAME AND MONTH NAME FROM CURRENT DATE

Somesh

Total Post:21

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

thanks
  1. Amit Singh

    Post:103

    Points:721
    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 Oct-11-2011 08:59:50 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!