API Documentation

Examples

Use the Convert API with PHP

$timestamp = time();
$returnType = 'php';
$timezone = 'Vienna';
$requestUri = sprintf('http://www.convert-unix-time.com/api?timestamp=%s&timezone=%s&returnType=%s',
    $timestamp, $timezone, $returnType);

$response = file_get_contents($requestUri);
$result = unserialize($response);
var_dump($result);

Use the API with jQuery

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function convertUnixTimeCallback(result){
    console.log(result);
}
$(function(){
    var baseUri = 'http://www.convert-unix-time.com/api?';
    $.getScript(baseUri+'timestamp=now&returnType=jsonp&callback=convertUnixTimeCallback');
});
</script>

Reference


Do you have questions?

Don't hesitate and contact us via twitter if you have any problems with the API.