PDA

View Full Version : Converting timestamp


steven s
01-04-2007, 12:27 AM
This is actually something for PhotoPost Classfieds.
I think I have a better chance here getting a hand here.
I added this to a rss script
enddate is the ending timestamp of the ad
// expiration date
if ( !empty($data['enddate']) ) $data['enddate'] = "<br /><br />Expires: ". $data['enddate'];and$item->description = "$thumb<br /><br />Posted by: ". $data['user'] . $data['description']. $data['enddate'];
As written it posts the *nix timestamp.
I have used $newenddate = formatppdate($enddate) in another place but don't know how to reformat enddate here.

Guest190829
01-04-2007, 12:53 AM
For vBulletin, converting TIMESTAMPS to readable strings is done with the vbdate() function. Documentation can be found in both the API at

members.vbulletin.com/api/

or in functions.php.

steven s
01-04-2007, 10:26 AM
Thanks but I was hoping for a php function, not something unique to vB or PhotoPost classifieds.

Guest190829
01-04-2007, 06:12 PM
PHP's date (http://www.php.net/date) function is then what you are looking for.