MySql Date/Time Functions
Date/Time Functions
Name | Description |
---|---|
ADDDATE() | Add time values (intervals) to a date value |
ADDTIME() | Add time |
CONVERT_TZ() | Convert from one timezone to another |
CURDATE() | Return the current date |
CURRENT_DATE(),CURRENT_DATE | Synonyms for CURDATE() |
CURRENT_TIME(),CURRENT_TIME | Synonyms for CURTIME() |
CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP | Synonyms for NOW() |
CURTIME() | Return the current time |
DATE_ADD() | Add time values (intervals) to a date value |
DATE_FORMAT() | Format date as specified |
DATE_SUB() | Subtract a time value (interval) from a date |
DATE() | Extract the date part of a date or datetime expression |
DATEDIFF() | Subtract two dates |
DAY() | Synonym for DAYOFMONTH() |
DAYNAME() | Return the name of the weekday |
DAYOFMONTH() | Return the day of the month (0-31) |
DAYOFWEEK() | Return the weekday index of the argument |
DAYOFYEAR() | Return the day of the year (1-366) |
EXTRACT() | Extract part of a date |
FROM_DAYS() | Convert a day number to a date |
FROM_UNIXTIME() | Format UNIX timestamp as a date |
GET_FORMAT() | Return a date format string |
HOUR() | Extract the hour |
LAST_DAY | Return the last day of the month for the argument |
LOCALTIME(), LOCALTIME | Synonym for NOW() |
LOCALTIMESTAMP,LOCALTIMESTAMP() | Synonym for NOW() |
MAKEDATE() | Create a date from the year and day of year |
MAKETIME() | Create time from hour, minute, second |
MICROSECOND() | Return the microseconds from argument |
MINUTE() | Return the minute from the argument |
MONTH() | Return the month from the date passed |
MONTHNAME() | Return the name of the month |
NOW() | Return the current date and time |
PERIOD_ADD() | Add a period to a year-month |
PERIOD_DIFF() | Return the number of months between periods |
QUARTER() | Return the quarter from a date argument |
SEC_TO_TIME() | Converts seconds to 'HH:MM:SS' format |
SECOND() | Return the second (0-59) |
STR_TO_DATE() | Convert a string to a date |
SUBDATE() | Synonym for DATE_SUB() when invoked with three arguments |
SUBTIME() | Subtract times |
SYSDATE() | Return the time at which the function executes |
TIME_FORMAT() | Format as time |
TIME_TO_SEC() | Return the argument converted to seconds |
TIME() | Extract the time portion of the expression passed |
TIMEDIFF() | Subtract time |
TIMESTAMP() | With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments |
TIMESTAMPADD() | Add an interval to a datetime expression |
TIMESTAMPDIFF() | Subtract an interval from a datetime expression |
TO_DAYS() | Return the date argument converted to days |
TO_SECONDS() | Return the date or datetime argument converted to seconds since Year 0 |
UNIX_TIMESTAMP() | Return a UNIX timestamp |
UTC_DATE() | Return the current UTC date |
UTC_TIME() | Return the current UTC time |
UTC_TIMESTAMP() | Return the current UTC date and time |
WEEK() | Return the week number |
WEEKDAY() | Return the weekday index |
WEEKOFYEAR() | Return the calendar week of the date (0-53) |
YEAR() | Return the year |
YEARWEEK() | Return the year and week |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/195110/viewspace-1081298/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Expression Date FunctionsExpressFunction
- Oracle Date FunctionsOracleFunction
- mysql資料庫date 、datetime、time、timestamp區別MySql資料庫
- Mysql日期(DATE, TIME, DATETIME, TIMESTAMP)型別的比較MySql型別
- Unable to convert MySQL date/time value to System.DateTimeMySql
- oracle ocp 19c考題,科目082考試題-date/time functionsOracleFunction
- mysql-資料庫欄位date datetimeMySql資料庫
- java convert timestamp to date and timeJava
- python date 和 datetime 的取值範圍(對比 Mysql 的 datetime 和 timestamp)PythonMySql
- Linux change date timeLinux
- mysql中的date、datetime、timestamp你還不知道怎麼使用嗎MySql
- java8 Date/Time APIJavaAPI
- oracle plsql定義date_timestamp_with time zoneOracleSQL
- java儲存時間date到mysql的datetime格式的方法JavaMySql
- new Date(date).getTime()在蘋果手機不相容蘋果
- oracle timestamp轉換date及date型別相減Oracle型別
- date、timestamp欄位型別型別
- java:Date和DateTime區別Java
- mysql DATE_ADD DATE_SUBMySql
- BUG: JS 修改Date的TimezoneJS
- js基礎–Date.parse()與Date.getTime()方法詳解JS
- 面試題:能談談Date、Datetime、Time、Timestamp、year的區別嗎?面試題
- Mysql date_format 與 Oracle to_char(date,’format’)MySqlORMOracle
- Oracle中Date和Timestamp的區別Oracle
- Python Date and Time & Conditionals controlPython
- Java 8 日期/時間(Date Time)API指南JavaAPI
- 將timestamp轉成date格式的指令碼指令碼
- LocalDateTime替代Date操作處理日期時間LDA
- mysql DATE_FORMAT函式MySqlORM函式
- [20111229]date time timestamp? ansi liternals.txt
- MySQL: datetime vs timestampMySql
- mongoose的date型別和timestamps的使用Go型別
- date和timestamp型別之間的轉換型別
- String和Date、Timestamp之間的轉換
- JAVA裡的String、Timestamp、Date相互轉換Java
- How to Convert a Date Time to “X minutes ago” in C# zGoC#
- 將timestamp型別轉換為date型別型別
- JAVA基礎:謹慎使用Date和Time類(轉)Java