opera ghost
New Member
Hi guys i am really new to php and i am trying to convert the timestamp from an xml array but with no sucess , i read everything i found but still can find the way can you please help ?I am using this code to decode an xml api output \[code\]$mysongs = simplexml_load_file('http://example.com/test/xml/');$timestamp = $mysongs->item->timestamp;$playtime = date("Y-d-m G-i-s",$timestamp);\[/code\]If i echo $timestamp it works fine, $playtime doesn't...Tried with :\[code\]echo gmdate("Y-m-d", $timestamp);\[/code\]&\[code\]echo date('Y-m-d H:i:s', $wra);\[/code\]&\[code\]echo '<timeplayed>' . date('Y-m-d G:i:s', $mysongs->item->timestamp) . '</timeplayed>';\[/code\]Still no luck.. Time is not showing.. If i use this example\[code\]echo '<timeplayed>' . date('Y-m-d G:i:s', (1365532902)) . '</timeplayed>';\[/code\]it works fine.. What am i doing wrong here ?Update : The script that outputs this xml is using \[code\]['timestamp'] = strtotime\[/code\] to encode time if this is helpfull.