Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert Dec-03-03 to 12/3/2003 ?

    I am trying to figure out how to convert the following date format:

    Dec-03-03 (MMM-DD-YY)

    into

    12/03/2003



    Any native php functions to do this? I couldn't find anything.

    Php only, not MySQL.

    Thanks,
    J

  • #2
    New Coder
    Join Date
    May 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok you will have to slightly change the form of your date but there is a function that can do it.

    strtotime() can convert english dates into a timestamp then from there you can use date() to format it to your choice.

    echo date ("m/d/Y",strtotime ("Dec 03 03"));

    (notice the removal of the -

    but if you are stuck with that format you can always remove the dash before processing

  • #3
    New Coder
    Join Date
    Nov 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks very much, I'll try that

  • #4
    New Coder
    Join Date
    Nov 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You rock! thanks. WOrked great.


  •  

    Posting Permissions

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