Current time code - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: Current time code (/showthread.php?tid=934) Pages:
1
2
|
Current time code - rockclimber66 - 10-09-2009 Hi, I'm building a new personal site and would like to show like "23:34" (not 11:34 pm, in the 24h format) in the bottom corner. I just need the code, I'll style and work around it myself. Preferably just hours and minutes, but if you have something with seconds as well it doesn't matter. Oh but if does actually includes seconds, please make it keep counting, you know.. like, it 'reloads' itself. So I don't have to refresh the page so the seconds change. And obviously I mean a countup little clock. I just really want the chars, not in a box or inside something else.. as simple as: "hours:minutes". RE: Current time code - Elektrisk - 10-09-2009 This would probably get better results in the PHP section. If you agree, report your post and say, "Please move this to the PHP section" or otherwise ^^ RE: Current time code - Alex - 10-09-2009 PHP would be best but there are a number of ways to do clocks. http://us2.php.net/manual/en/function.date.php That's where you'll find all the time and date functions of php so you can get to look how you want ;). RE: Current time code - Gaijin - 10-09-2009 Here you go time.php PHP Code: <?php HTML file javascript from : http://www.w3schools.com/Ajax/ajax_xmlhttprequest.asp Code: <html> If you want to output only Hours:Minutes just remove "" from the date() function PHP Code: <?php RE: Current time code - rockclimber66 - 10-10-2009 Thanks a bunch! Working just great. This is exactly what I wanted. Again, thanks for your help, appreciated. RE: Current time code - Gaijin - 10-10-2009 (10-10-2009, 02:02 AM)faviouz Wrote: Thanks a bunch! Working just great. This is exactly what I wanted. Thank you too. But the above code isn't working proberly in IE 5 and under. RE: Current time code - Code King - 10-10-2009 Lol which retard still uses ie5- RE: Current time code - Gaijin - 10-10-2009 (10-10-2009, 09:26 AM)Code King Wrote: Lol which retard still uses ie5- lol I do/ well I don't but it is installed and I don't update it, just have no reason for that. RE: Current time code - Legion - 10-10-2009 (10-10-2009, 09:19 AM)NinjaGeek Wrote: Thank you too. Actually a lot probably. In June 2008 it was good for 0,5% of all browser, that means 1 out o 200 people used internet explorer 5. There are no new statistics but you should still code with the face in mind that it is still used a lot. RE: Current time code - Alex - 10-10-2009 (10-10-2009, 10:13 AM)Legion Wrote: Actually a lot probably. In June 2008 it was good for 0,5% of all browser, that means 1 out o 200 people used internet explorer 5. There are no new statistics but you should still code with the face in mind that it is still used a lot. Yes, because I'm worried about the .5% of people probably don't used a computer everyday. http://www.w3schools.com/browsers/browsers_stats.asp The W3C doesn't even keep track of it anymore. It's a dead browser. |