开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜