I was wondering if there is a way to automatically get a user's timezone? I want to show certain information if the user's current date is less than the expiry date. It works fine if the user is in a default timezone but what if the user is in a different timezone? How I can I make sure I can get their correct current time?
date_default_timezone_set('America/New_York');
$expiry_date = trim($row['expiry_date']);
$current_date = date('Y-m-d H:i:s');
if($current_date < $expiry_date) {
// show data
} else {
// don't show
}