Page 1 of 1

any getTime method on server side ?

Posted: 04 Jun 2011, 08:17
by kotbegemot
Any getTime method on server side ?
I need to getTime for every day bonus for player

Posted: 04 Jun 2011, 10:55
by rjgtav
hi. If you are using AS extensions, there are some getDate methods, like in Flash. So im pretty sure there.s also for getting the time. Sorry im on mobile but you can try searching on Google

Posted: 04 Jun 2011, 14:39
by kotbegemot
Thanks !!!

But very strange

Code: Select all

trace(String(today_date.getFullYear()));
trace(String(today_date.getMonth()));
trace(String(today_date.getDate()));

trace
4
5
2011

But today is 04.06.2011

Posted: 04 Jun 2011, 14:45
by kotbegemot
I use just +1, but why.....

Posted: 04 Jun 2011, 14:46
by rjgtav
if i remember correctly, on the month case, you need to do today_date.getMonth()+1.

=EDIT=
I think its a flash bug, not sure. For some reason it starts the month count from 0 instead of 1

Posted: 04 Jun 2011, 16:06
by kotbegemot

Code: Select all

var today_date = new Date(); 

var date_str = String(today_date.getFullYear()+"_"+(today_date.getMonth()+1)+"_"+today_date.getDate());
		

Posted: 04 Jun 2011, 16:07
by kotbegemot
Thanks !!!