Can we convert Ticks to datetime in MySQL?
I have a column from a C#开发者_运维百科 application whose value is in Ticks. Is there a MySQL query to convert it into DATETIME with milliseconds?
I think MySQL DATETIME will not hold milliseconds, see Bug 27838. Therefore I think you can only do this:
DateTime sqlDateTime = new DateTime(someTickVariable);
You can then use sqlDateTime.ToString("yyyy-MM-dd HH:mm:ss")
to get a MySQL conforming String like 2010-12-31 14:00:00
.
精彩评论