Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2899] Android: date_instance.UTC() is not a method

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2011-12-30T12:36:19.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterKeith Gable
AssigneePaul Dowsett
Created2011-12-30T09:37:33.000+0000
Updated2016-03-08T07:47:52.000+0000

Description

Problem

An instance of Date does not have a UTC() method. On iOS and in Normal JavaScript(TM), UTC() exists and returns the correct value.

Test case

var thisDate=Date.UTC(2005,7,8);
Ti.API.info("Number of milliseconds from January 1, 1970 to August 8, 2005, according to universal time " + thisDate);

Output / Logs

1064                  TiAPI  I  Number of milliseconds from January 1, 1970 to August 8, 2005, according to universal time 1123459200000

Comments

  1. Paul Dowsett 2011-12-30

    Keith I am unable to reproduce this issue. In order for me to accept any further tickets from you, all the fields must be complete and the body must include all the information detailed in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist). I have reformatted this ticket to give you a guide for future reports. If your future tickets are well-formed, then I can get them escalated without any delays. Thank you for your cooperation and understanding about why this is necessary. Cheers
  2. Keith Gable 2011-12-30

    Actually, upon testing this again, I can't get it to reproduce either. Go ahead and close this invalid :)
  3. Paul Dowsett 2011-12-30

    The error was probably caused by .UTC() being called on a date object instance, whereas it is actually a method of the [Date](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date) constructor. I hope you can appreciate the time it can take us to reproduce issues that are any more complex than this, and thus why a test case is always required. Please refer to [Creating a Test Case](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase) for guidance. Thanks

JSON Source