How's this?
date("g:i:s a", strtotime("{$time} UTC"))
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
function twentyfourToTwelve($time)
{
return date('g:i:s a', strtotime($time . " UTC"));
}
/*** Example usage ***/
echo twentyfourToTwelve('15:33:56');
This work?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
What is wrong with ardav's post?
12 Hour format is 01:01:01 PM
24 Hour format is 13:01:01
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
For **** sakes Ayesha, if you'd said you wanted Pakistan time, that would have been straight forward - we ain't got no crystal balls you know. Look at the php documentation on setting times. Sheesh...
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080