Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Within my multisite installation I can get the registered and last updated time strings for a sub blog through get_blog_details and the blog ID:

echo get_blog_details($blog_ID)->registered

Ok, how do I format the resulting time string:

2011-09-28 00:20:34

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted
$time = get_blog_details($blog_ID)->registered;
$unix_time = strtotime($time);

$my_time_format = date('Y-m-d H:i:s', $time);  // eg. 2011-09-28 00:20:34
$diff_format = human_time_diff($time);          // eg. 2 days

See date() and replace Y-m-d H:i:s with the format you want

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.