Purpose: To get time zone of a remote file in my time zone. I have to download a file daily (mp3, don’t worry its legal!) from BBC. Problem is that sometimes BBC doesn’t update the file and i have to download entire file to check if it has been updated or not. Hence i decided to code a page that gives me date and time of that remote file. I have successfully compiled the code (that i got from internet). But the time returns in EST. I want the time in IST (indian std time Asia/Calcutta). CURLINFO_FILETIME has bee used. Below is code.
Pls suggest me how to convert EST to IST
Warning: I am n00b
But not f00l.
[php]<?php
$curl = curl_init(‘http://wsdownload.bbc.co.uk/hindi/tx/32mp3/din_bhar.mp3’);
//don’t fetch the actual page, you only want headers
curl_setopt($curl, CURLOPT_NOBODY, true);
//stop it from outputting stuff to stdout
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// attempt to retrieve the modification date
curl_setopt($curl, CURLOPT_FILETIME, true);
$result = curl_exec($curl);
if ($result === false) {
die (curl_error($curl));
}
$timestamp = curl_getinfo($curl, CURLINFO_FILETIME);
if ($timestamp != -1) { //otherwise unknown
echo “BBC Hindi was last modified” . date(“d-m-Y h:i:s A T”, $timestamp); //etc
} ?>[/php]
I have used it with custom getRemoteFileSize function here:-
http://island.web44.net/bbc.php