dunn_cann Posted January 4, 2007 Share Posted January 4, 2007 Know this is going to sound stupid but could someone please tell me how to write out a variable as today's date. I have been using:$todays_date =/" 4 /" 01/" 07/"; and it just won't work. Thanks all. Link to comment https://forums.phpfreaks.com/topic/32846-todays-date/ Share on other sites More sharing options...
metrostars Posted January 4, 2007 Share Posted January 4, 2007 Do you just want the current date?That would be $todays_date = date('d/m/Y');That would give the date like 01/01/2007. i think thats what you want Link to comment https://forums.phpfreaks.com/topic/32846-todays-date/#findComment-152889 Share on other sites More sharing options...
dunn_cann Posted January 4, 2007 Author Share Posted January 4, 2007 Hey Metrostar thanks for the rapid reply and of course the help. Cheers! Link to comment https://forums.phpfreaks.com/topic/32846-todays-date/#findComment-152892 Share on other sites More sharing options...
obsidian Posted January 4, 2007 Share Posted January 4, 2007 [quote author=dunn_cann link=topic=120988.msg496806#msg496806 date=1167918589]Hey Metrostar thanks for the rapid reply and of course the help. Cheers![/quote]In addition, if you get into dealing with other dates, you'll want to check into some of the other date/time handling functions:[url=http://www.php.net/mktime]mktime()[/url][url=http://www.php.net/strtotime]strtotime()[/url][url=http://www.php.net/time]time()[/url][url=http://www.php.net/strftime]strftime()[/url]There are also some other ones that will help you out, too. Link to comment https://forums.phpfreaks.com/topic/32846-todays-date/#findComment-152902 Share on other sites More sharing options...
dunn_cann Posted January 4, 2007 Author Share Posted January 4, 2007 Hiya ObsidianI have only got as far as creating my own variables so far in my PHP education and just wanted to know how to add the date correctly but i'll definately be checking out the other date/time handling functions you have provided the links for. Big thanks!! Link to comment https://forums.phpfreaks.com/topic/32846-todays-date/#findComment-152959 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.