Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

Date Insert

What formatting, or what do i need to do to get my date to look like this in the mySQL database?

1303623202

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

4/28/2011 2:14:54 PM

Does that matter?
0
theideabulb
Asked:
theideabulb
  • 2
1 Solution
 
SharathData EngineerCommented:
How did you get 1303623202 from 4/28/2011 2:14:54 PM? What is the logic?
0
 
mankowitzCommented:
you need to use the from_unixtime() command.

for example

INSERT table (event_time) VALUES FROM_UNIXTIME(1303623202);
0
 
theideabulbAuthor Commented:
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.
0
 
theideabulbAuthor Commented:
Great job.

I actually used a UDF from CFLIB.org

http://cflib.org/udf/GetEpochTime
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now