1

Here I got a data like this: 1320609435.346877000, and I was told it was UNIX time which I do not understand. Shouldn't UNIX time look like an integer?

This data is stored in a txt as a column, if I want to insert this column into Mysql, which data type should I use and when I create a table, this default value should be assigned as NULL or ?

Many thanks!

1 Answer 1

1

In MySql I always prefer using DATETIME type.
So you could use:

INSERT INTO your_table (your_col)
    SELECT FROM_UNIXTIME(your_num)

See reference here.
Unix time you posted (1320609435.346877000) is 2011-11-06 20:57:15.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.