Page 1 of 1

7 day items: time in items BBD table?

Posted: Tue Feb 08, 2011 3:50 pm
by kube
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:

Hi, i'm searching how the server calcule the time for insert a new 7 day item to one user. I'm trying with date/mktime function but i can't obtain a correct timestamp value. How i can calculate this value?

Regards.

Re: 7 day items: time in items BBD table?

Posted: Tue Feb 08, 2011 4:10 pm
by Flashy
other question, what is the target? why u want calc this value?

Re: 7 day items: time in items BBD table?

Posted: Tue Feb 08, 2011 4:21 pm
by kube
I'm trying get a 7 day horse reward for vote my server, then i use the INSERT mysql function with the correct values (owner_id, item_id...) but i can't get the value for the variable "time" for a 7 day items.

If i create ingame this item, i obtain this value (for now):

1297786714574

How i can obtain this value in php for isert it in the database?

I'm tryed using date and mktime functions for obtain a timestamp, but is not work.

How the server obtain this value??

Re: 7 day items: time in items BBD table?

Posted: Tue Feb 08, 2011 6:09 pm
by Flashy
in php.. use function: microtime() it return the unix timestamp within milisec. was what ur question?
this is exact the value u need for db insert...

example:

Code: Select all

   //Return the unix timestamp + microseconds  function micro_time()  {    $timearray = explode(" ", microtime());    return ($timearray[1] + $timearray[0]);  } 

Re: 7 day items: time in items BBD table?

Posted: Tue Feb 08, 2011 6:11 pm
by jurchiks
it's unixtime in milliseconds.

Re: 7 day items: time in items BBD table?

Posted: Wed Feb 09, 2011 8:45 am
by kube
Ok, my unixtime was in seconds :P

Thx for ur time!!!!

PD: Solved.