Jump to content


Photo

Calculating date


  • Please log in to reply
3 replies to this topic

#1 dquinney

dquinney
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 March 2006 - 10:50 AM

Hi, is it posible to calculate the day e.g. (Monday) based on having 17/03/2006 in php? If so does anyone have to correct code to do this as i have been searching in the php date function manual an cannot see how to do this.

Regards Danuel

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 17 March 2006 - 11:49 AM

use
<?php echo date('l',strtotime('3/17/2006')); ?>
(That's a lowercase "L".)

Ken

#3 dquinney

dquinney
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 March 2006 - 07:21 PM

Thanks Ken.

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 17 March 2006 - 07:52 PM

[!--quoteo(post=355968:date=Mar 17 2006, 02:21 PM:name=dquinney)--][div class=\'quotetop\']QUOTE(dquinney @ Mar 17 2006, 02:21 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Thanks Ken.
[/quote]

check out all the different powerful options available at your disposal within the date() function in the manual. it's really amazing what all you can do with combining some of the date/time functions.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users