Solar Posted April 26, 2010 Share Posted April 26, 2010 Using $_SERVER['REQUEST_TIME'] How could I make it so it just echo's HOUR:MINUTE:SECOND ?? www.php.net doesn't give enough information for that. Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/ Share on other sites More sharing options...
Alex Posted April 26, 2010 Share Posted April 26, 2010 $_SERVER['REQUEST_TIME'] is a unix time stamp, as such you can format it using date. Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1048299 Share on other sites More sharing options...
Solar Posted April 26, 2010 Author Share Posted April 26, 2010 Ahh Stupid me! So my answer is; date("Y-m-d H:i:s"); I added Year, Month, and Date as well. Thanks for your help! Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1048300 Share on other sites More sharing options...
Dragosvr92 Posted September 26, 2010 Share Posted September 26, 2010 just found this on Google by searcing for REQUEST_TIME and said id bump it ... Dos anyone have any idea how may i output the real date from the Time Stamp ? i would like to make some convertor to convert from DD.MM.YYYY Into a Unix Time stampand the vice versa... Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1115770 Share on other sites More sharing options...
jcbones Posted September 26, 2010 Share Posted September 26, 2010 just found this on Google by searcing for REQUEST_TIME and said id bump it ... Dos anyone have any idea how may i output the real date from the Time Stamp ? i would like to make some convertor to convert from DD.MM.YYYY Into a Unix Time stampand the vice versa... Anyway you want it. Couple with this which understands these formats echo date('Y-m-d',strtotime('30.12.2010')); Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1115776 Share on other sites More sharing options...
Dragosvr92 Posted September 26, 2010 Share Posted September 26, 2010 i figured out how to convert a TimeStamp to real time by doing this $time = $_SERVER['REQUEST_TIME'];//Onix Time Format print date('Y-m-d H:i:s', $time); // 2010-09-26 04:25:49 But i dont know how to convert 2010-09-26 04:25:49 Back to a Time Stamp Any ideas? nevermind .. i figured how to do it seems that the mktime function dos it Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1115910 Share on other sites More sharing options...
newbtophp Posted September 26, 2010 Share Posted September 26, 2010 i figured out how to convert a TimeStamp to real time by doing this $time = $_SERVER['REQUEST_TIME'];//Onix Time Format print date('Y-m-d H:i:s', $time); // 2010-09-26 04:25:49 But i dont know how to convert 2010-09-26 04:25:49 Back to a Time Stamp Any ideas? nevermind .. i figured how to do it seems that the mktime function dos it strtotime does that Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1115935 Share on other sites More sharing options...
Dragosvr92 Posted October 16, 2010 Share Posted October 16, 2010 i managed to do it one or two days after i posted that using : mktime() Link to comment https://forums.phpfreaks.com/topic/199730-_serverrequest_time/#findComment-1122701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.