![]() |
Time Online - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Support (https://community.mybb.com/forum-72.html) +---- Thread: Time Online (/thread-8150.html) |
Time Online - Maverickb7 - 2006-04-10 Hello-- I've been trying to figure out how I would go about convert the data inside the timeonline column in the mybb_users table to show as X hours, X Minutes, and X Seconds. Does anyone know how I coudl convert the number saved to the database column? If someone could provide some code or help I would appreciate it. Thanks! RE: Time Online - zaher1988 - 2006-04-10 Hello there, that time number you are talking about is UNIX Time Stamp, To convert it you will need to use
However MyBB has a function that will do the job
time to convert is the actuall time you want to convert wheter it was already set manually or retrived from a database etc... regards RE: Time Online - Maverickb7 - 2006-04-10 Alright... how would I put the first group of code into play? (Note: I'm using this within a file outside my forum directory) RE: Time Online - Michael S. - 2006-04-10 It is easier to use the MyBB function as it already exists:
RE: Time Online - zaher1988 - 2006-04-10 first from where you are trying to retrieve the time stamp? from the same database? or from a file? anyway, you will need a query something like
so let's assume that date is a unix time, the variable will become $stamp = $var['time']; so use $stamp along with the above code. and the final thing will look as
however try to include ./inc/functions.php and use the Mybb funtion nice_time .... regards RE: Time Online - Maverickb7 - 2006-04-10 Alright Thanks. I've managed to get it working nicely. ![]() |