Ask away

Javascript UTC Date issue

Melvin 01/05/18 14:52

26 views

Question CategoryConfiguration,Component,Properties

Number of completed projects0

Question StatusUnsolved

  • javascript
  • UTC
  • date
  • nest component

Question

I'm currently making a nest app and using Jquery library to apply for the components. Unfortunately, I'm noticing that there seem to be some inconsistent behavior mobile compatibilities in using Javascript's family of UTC date functions. Has anyone experienced similar issues with Android, iPhone in this regard? I currently think that it's a native browser issue as Chrome and Firefox seem to have the expected behavior. The normal usage of: var d = new Date(); var utc_month = d.getUTCMonth(); Yields an int value for desktop browsers and a NaN value for utc_month on mobile browsers. Any thoughts? I wasn't able to find much on js components about exposing datetime from native browsers~

Answers

1
Albert 01/13/18 09:59

Do you have the same typo in your code? I ran the following: var utc_month = d.getUTCMonth(); alert (utc_month);

Melvin 01/13/18 19:14

It's not working for me

Answer

Project

Image

Comment