Web Analytics Made Easy -
StatCounter converting date to day - CodingForum

Announcement

Collapse
No announcement yet.

converting date to day

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • converting date to day

    I have a date in the form dd/mm/yyyy and i need to know what day of the week that day is. Is there any php function to do this, and if so in what format must the date be given?
    Thanks!

  • #2
    I think you'd use the PHP date() function:
    http://ca.php.net/date

    For example, let's say your date is stored in $d, then
    PHP Code:
     $day date("l"$d); 
    If you look at all the different parameters on the date() webpage, you'll find it does just about everything.

    The only thing I'm not totally sure about is if your $d will definately work as the second parameter... read up on that.

    Good luck,
    Sadiq.

    Comment


    • #3
      thanks,

      That does return a day... but it is always the same day (Thursday)regardless of the date!! does the input date have to be in the form of a time stamp or is it ok just dd/mm/yy?

      Comment

      Working...
      X