如何在SQL或PHP中将十进制(16,4)转换为DATE或DATETIME [英] How to convert decimal(16,4) to DATE or DATETIME in SQL or PHP
问题描述
一个例子:
decimal(16,4)datetime
1334041225.5900 2012-04-10 09:00:25 +02:00
> (这个编号系统有可能在2012-04-10 09:00与Unix时间戳相交:25 +02:00)。 请参阅 date function 详细信息。 很有可能在SQL中进行转换,但您没有说出这是什么类型的DBMS。 I have a small problem with a field of my db... the submit time is in decimal(16,4) type and I need to convert it to DATE or DATETIME... but I dont get it... One example:
This appears to be a unix timstamp with fractions of seconds, in which case.... (it is possible that this numbering system intersects with Unix timestamps at 2012-04-10 09:00:25 +02:00). See the manual page for the date function for details of specifics. It's prob ably possible to do the conversion in SQL but you didn't say what type of DBMS this is. 这篇关于如何在SQL或PHP中将十进制(16,4)转换为DATE或DATETIME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!打印日期('r',1334041225.5900);
decimal (16,4) datetime
1334041225.5900 2012-04-10 09:00:25 +02:00
print date('r', 1334041225.5900);