top

How to use Date() on 2012 platform

Published 2014-10-27 | (Compatible with SDK 3.5,4.5,5.0,5.1 and 2012,2013,2014 models)

Date and time return values on 2012 platform

Date() instructions needs to be entered properly. Date must be specified in a Webkit prescribed format.

Source Files

Note

The files needed for the sample application are here.

Bad example

var firstinMonth = new Date(curMon+", 1, "+curYear);
// January == 1

Good example

var firstinMonth = new Date(curYear, curMon-1, 1);
// January == 0
// or
var firstinMonth = new Date(month_of_year[curMon-1] + " 1, " + curYear);
// month_of_year[0] == 'January' : Need definition