MySQL中from_unixtime与unix_timestamp差别
2014-07-23 15:40
465 查看
查阅官档:
Returns a representation of the
说明from_unixtime只是按照当前的时区,已指定的形式返回unix_timestamp值。
If called with no argument, returns a Unix timestamp (seconds since
不同点在与,unix_timestamp会受到本地时区的影响,有可能2个不同的timstamp对应一个unixtimestamp,而from_unixtime则是一一对应
FROM_UNIXTIME(unix_timestamp
), FROM_UNIXTIME(unix_timestamp
,format)
Returns a representation of the
unix_timestampargument as a value in
'YYYY-MM-DD HH:MM:SS'or
YYYYMMDDHHMMSSformat, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone.
unix_timestampis an internal timestamp value such as is produced by the
UNIX_TIMESTAMP()function.
说明from_unixtime只是按照当前的时区,已指定的形式返回unix_timestamp值。
UNIX_TIMESTAMP(),
UNIX_TIMESTAMP(date
)If called with no argument, returns a Unix timestamp (seconds since
'1970-01-01 00:00:00'UTC) as an unsigned integer. If
UNIX_TIMESTAMP()is called with a
dateargument, it returns the value of the argument as seconds since
'1970-01-01 00:00:00'UTC.
datemay be a
DATEstring, a
DATETIMEstring, a
TIMESTAMP, or a number in the format
YYMMDDor
YYYYMMDD. The server interprets
dateas a value in the current time zone and converts it to an internal value in UTC
不同点在与,unix_timestamp会受到本地时区的影响,有可能2个不同的timstamp对应一个unixtimestamp,而from_unixtime则是一一对应
相关文章推荐
- MYSQL DATE_FORMAT以及UNIX_TIMESTAMP 和FROM_UNIXTIME 函数整理
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- mysql中UNIX_TIMESTAMP和FROM_UNIXTIME时间戳
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- mysql时间格式函数:from_unixtime()、unix_timestamp()、date_format()
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- mysql版本 5.6.10,UNIX_TIMESTAMP和FROM_UNIXTIME支持最大时间戳转换
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()区别
- mysql 中 unix_timestamp和from_unixtime 时间戳函数
- Mysql unix_timestamp() FROM_UNIXTIME和DATE_FORMAT(date,format)
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()函数的区别
- from_unixtime/unix_timestamp mysql时间操作
- Mysql日期时间类型(DATE,DATETIME,TIMESTAMP)和函数及与linux系统时间之间的转换(UNIX_TIMESTAMP、FROM_UNIXTIME)
- MySQL查询中时间转换--UNIX_TIMESTAMP()和from_unixtime()的使用
- Mysql中的from_unixtime,unix_timestamp 整型与datetime 字符串之间的转换
- SQL Server时间粒度系列----第6节基于当前日的小时数和分钟数与mysql unix_timestamp和from_unixtime的mssql实现