date-month wrong

Post bugs here!
Post Reply
kevinotton
Posts: 39
Joined: Thu May 15, 2014 8:18 am
Location: Needham Market, Suffolk, UK

date-month wrong

Post by kevinotton »

The following code is giving me the wrong date. Displays 08/1/2015 not 08/2/2015.

var date = xui.Date,d = new Date();
ns.timelabel.setCaption(date.get(d,'d')+"/" + date.get(d,'m') +"/"+ date.get(d,'y') +" "+ date.get(d,'h')+":" + date.get(d,'n') +":"+ date.get(d,'s') );

Thanks
Kevin

support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

Re: date-month wrong

Post by support »

In javascript , moth is based on 0.

0 -> January

Post Reply