Date Insert

Posted on 2011-04-28
Last Modified: 2012-05-11
What formatting, or what do i need to do to get my date to look like this in the mySQL database?


I will be inserting from another table that has a format  like this:

4/28/2011 2:14:54 PM

Does that matter?
Question by:theideabulb
    LVL 40

    Expert Comment

    How did you get 1303623202 from 4/28/2011 2:14:54 PM? What is the logic?
    LVL 24

    Accepted Solution

    you need to use the from_unixtime() command.

    for example

    INSERT table (event_time) VALUES FROM_UNIXTIME(1303623202);

    Author Comment

    Sharath, i had no idea how that was being insert into the db myself.  Not sure what the reasoning is behind that type of format either.  This is what the ExpressionEngine CMS system does.

    mankowitz, thank you, i will give that a shot.

    Author Closing Comment

    Great job.

    I actually used a UDF from

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi ( had suggested a “sed” way, I actually shell …
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now