WordPress Locale Switching on Accept-Language Header

that’s going to be a bit tricky since WordPress doesn’t relate date and time format to language. so to get the current language from the browser you can use $_SERVER['HTTP_ACCEPT_LANGUAGE'] and then based on that you can change the date format:

function update_date_format(){
    $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
    if (strpos($lang, 'au') > 0){
        $date_format="d/m/Y"; // 25/12/2011
    }else{
        $date_format="m/d/Y"; // 12/25/2011
    }
    update_option('date_format',$date_format);
}

after you paste this function in your theme’s functions.php add to your theme’s header.php at the very top:

<?php update_date_format(); ?>