Advanced Search

Results 1 to 3 of 3

Thread: date formatting

  1. #1
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default date formatting

    hi i was wondering if any1 could help me with this.

    i am receiving data in this format:
    1207
    which is the month followed by year : mmyy

    so i was wondering if i could change this to a real date format
    as in like dd/mm/yyyy

    01/12/2007

    thanks

  2. #2
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Here is a bit of code that will point you in the correct direction:

    Code:
    <?php
    $str = '1207';
    echo date('F j, Y', mktime(0,0,0,$str{0}.$str{1},1,$str{2}.$str{3}));
    ?>

  3. The Following User Says Thank You to Jeremy Ross For This Useful Post:

    awakener1986 (01-22-2010)

  4. #3
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks exactly what i needed

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
  •