I’m currently making a jQuery Mobile application and using Phone Gap to deploy to multiple platforms. Unfortunately, I’m noticing that there seems to be some inconsistent behavior between the desktop and mobile compatibilities in using Javascript’s family of UTC date functions.
Has anyone experienced similar issues with Android, iPhone, and / or Blackberry 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 PhoneGap about exposing datetime from native browsers~
The example works fine for me on Android 2.2 with PhoneGap (after changing ‘int utc_month …’ to ‘var utc_month …’).
Do you have the same typo in your code? I ran the following:
6 gets alerted.