function get_attachment_folder_time($post_id)
{
$time = current_time('timestamp');
if (!($attach = get_post($post_id))) {
return $time;
}
if (!$attach->post_parent) {
return $time;
}
if (!($post = get_post($attach->post_parent))) {
return $time;
}
if (substr($post->post_date_gmt, 0, 4) > 0) {
return strtotime($post->post_date_gmt . ' +0000');
}
return $time;
}