utilizzando PHP
Codice PHP:
<?php //timestamp.php
$server_time = date("d m Y");
echo "&server_time=$server_time";
?>
codice:
var useDate = function(date){
// azioni per l'utilizzo della data, richiamandola all'interno della funzione
// con il nome del parametro, "date"
}
var s_time = new Date();
var lv = new LoadVars();
lv.onLoad = function(ok){
if(ok){
var temp = this.server_time.split(" ");
s_time.setDate(temp[0]);
s_time.setMonth(Number(temp[1])-1);
s_time.setFullYear(temp[2]);
_level0['useDate'](s_time);
}
}
lv.load("timestamp.php");