Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: Time is shown as NaN Format

$
0
0

Hi Rohit

 

In JavaScript when an arithmetic operation fails it does not throw an error; instead it returns a special numeric value, called NaN (for Not a Number), and the program happily continues with execution. The following operations all result in NaN:

 

 

0 / 0;                  => Nan.

"Hi" / 1;          => Nan. "Hi" cannot be converted to number

NaN / 0;             => Nan. Any operation with NaN results in NaN

 

 

The JavaScript typeof operator does not distinguish between NaN and numbers, therefore the expression typeof NaN === "number" returns true. Furthermore, NaN does not compare equal to any number, including a comparison with itself, thus NaN == NaN returns false

 

So use SimpleDateFormat may be help you.

 

BR,

Durga.


Viewing all articles
Browse latest Browse all 8533

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>