Javascript Date Method- (MM/dd/yyyy)

Javascript date methodJavascript Date Method has its own behavior in getting the date. One of the working tricks would be to separate date, month and year and concatenate it into one single string by then you can have full control of what specific format you want to achieve.

 

For ASP.NET MVC topic, you can visit ASP.NET MVC Development.

 

 

 

Javascript Date Method – Date Tricks

Below is a sample Javascript trick.

Note:

  • getMonth() -> January = 0; February = 1 ,March = 2 .
  • getDate() -> Get the day of a date
  • getFullYear() -> Get the year of a date (2017)

Output:

“11/11/2017”

Hope this helps. Thank you for reading! Happy COding!!

Leave a Reply

Your email address will not be published. Required fields are marked *