profile field unix time conversion

is it possible for a custom profile field that is in unix time, to be converted to regular datetime format when displayed on the profile?

here's what i have and why im wondering: i have a minecraft server, with the communitybridge plugin, and the plugin injects it's data into the profile field in the database, set as mclastonline. it injects as unix time, which i cant decipher, as it's just numbers. here is what it shows: 1361290167

can you read that? lol it's a date and a time that should be in the format: 2013-2-19 8:01 AM or similar.

from that, it calculates the total time played, which is suppose to insert as a formatted field such as 10 minutes, or 1 day 3 hours 3 minutes, but instead i can only get it to work as a number, such as 47.

any ideas?

Quote · 20 Feb 2013

I would suggest to add PHP block to profile page with content like this:

$aInfo = getProfileInfo($this->oProfileGen->_iProfileID);
return _format_when($aInfo['custom_profile_field_with_unix_timestamp']);
// or
return getLocaleDate($aInfo['custom_profile_field_with_unix_timestamp'], BX_DOL_LOCALE_DATE);
Rules → http://www.boonex.com/terms
Quote · 21 Feb 2013

PHP has a built in function you can use to convert a Unix timestamp to a date and time.  It is date().  Go and search php date() and you will see a whole list of options to format the date to whatever you wish.  Heck, go here: http://php.net/manual/en/function.date.php

Geeks, making the world a better place
Quote · 21 Feb 2013

I'll have to look into this. Ty

Quote · 22 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.