javascript new date not working in iphone and android devices with NAN and Undefined error

Today i found a new problem, the date object working perfectly in desktop web browsers but not working in android browsers and iphone browsers. The problem is they issue NAN and Undefined errors. So what is the universal solution? There is a simple solution to the problem. You should declare date as following format:

If you are processing date from php then the format for php date is:

Hope this technique works for web browsers in desktop and mobile devices.

About the Author

has written 31 stories on this site.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2017 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes