7 day items: time in items BBD table?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
kube
Posts: 15
Joined: Thu Jan 06, 2011 5:19 pm

7 day items: time in items BBD table?

Post 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.
User avatar
Flashy
Posts: 310
Joined: Mon Sep 29, 2008 11:49 am
Location: Germany

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

Post by Flashy »

other question, what is the target? why u want calc this value?
kube
Posts: 15
Joined: Thu Jan 06, 2011 5:19 pm

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

Post 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??
User avatar
Flashy
Posts: 310
Joined: Mon Sep 29, 2008 11:49 am
Location: Germany

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

Post 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]);  } 
Last edited by Flashy on Tue Feb 08, 2011 6:12 pm, edited 1 time in total.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

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

Post by jurchiks »

it's unixtime in milliseconds.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
kube
Posts: 15
Joined: Thu Jan 06, 2011 5:19 pm

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

Post by kube »

Ok, my unixtime was in seconds :P

Thx for ur time!!!!

PD: Solved.
Post Reply