SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast nerf's Avatar
    Join Date
    May 2004
    Location
    Sunshine Coast, Australia
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question the day of date variable

    i have a variable called $date1

    PHP Code:
     $date1 date("Y-m-j"); 
    So how would i then assign the day of $date to another variable called $ddate
    so i could then assign the month to $mdate etc....

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Try the following:

    PHP Code:
    $date1 date('Y-m-k');
    list(
    $ydate$mdate$ddate) = explode('-'$date1); 
    ... or if you don't need the full date (which is stored in $date1):

    PHP Code:
    list($ydate$mdate$ddate) = explode('-'date('Y-m-j')); 
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    SitePoint Enthusiast nerf's Avatar
    Join Date
    May 2004
    Location
    Sunshine Coast, Australia
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mate!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •