SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: convert time

  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    convert time

    Hi guys

    how could i convert this


    21042008
    into this format

    1208776064

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    $tmpDate = 21042008;
    $newDate = mktime(0,0,0, substr($tmpDate, 2, 2), substr($tmpDate, 0, 2), substr($tmpDate, 4, 4));
    echo "Current: $tmpDate<br />New: $newDate<br />Parsed: ".date("D F Y", $newDate);



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
  •