While using Google Analytic API to get the unique visitors and date, I got date in funky format. I thought date is return as time. So I tried convert it in php echo date(‘Y-m-d’,’20130811′). I only got wired date. After that I just look into the google documents and I realized date is in integer in the format YYYYMMDD.
The date of the visit. An integer in the form YYYYMMDD.
So just write a code to convert the date in proper format
$datestring = '20130811'; $year = substr($datestring,'0',4); $month = substr($datestring,4,2); $day = substr($datestring,6,2); echo $date = $year.'-'.$month.'-'.$day;