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 3 of 3

Thread: date problems

  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    date problems

    hye... i have a problem here. try to keep this simple.

    i got a database file that was exported by a software (dont remember) and it got the document date column. the problem is the date that was exported was not in any format that i know. instead of 10/10/06 or any known format, it displayed 1061010.

    the first number that is 1, didnt have anything to do with date. it just some thing that the software did to i dont know what.

    it should be 061010 rite? how to "translate" that into a proper format? let say 10/10/06

    i need the date to make the system works. can someone help me?

    thanks in advance!
    Last edited by zamaverick; 01-28-2007 at 03:33 PM. Reason: forget to mention somthing

  • #2
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    The format is fine, no corruption or anything. Basically you want to use php's date() function to take that timestamp and reformat it to your needs.

    http://php.net/date will tell you everything you need to know. Read the user comments too.

    An example using the stamp you mentioned would be:

    PHP Code:
    $dstamp '1061010';
    $frmt_date date('m/d/y'$dstamp);
    echo 
    $frmt_date
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    still cant work that out... can anyone give me details of this?

    the data in date column in the database that i have all start with number 1xxxxxx...

    that means if the date was 29/12/2006.... it will display 1061229... its like 1ymd or something....

    i try using above code ... but it return 70/01/01... that means 1st jan 1970 rite?

    can some one help me how to display the date in more sensible manner?

    newbies needed help here...

    thankssss
    Last edited by zamaverick; 01-28-2007 at 10:33 PM. Reason: afraid people thought that i have settled this problem... i didnt.. :D


  •  

    Posting Permissions

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