일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 오라클
- Data and Time Functions
- 방화벽
- HTTP
- MySQL
- Date and Time Functions
- 전자정부표준프레임워크
- 티베로
- 윈도우
- String Functions and Date Operators
- Date and Time Function
- 전자정부 표준프레임워크
- String Functions and Operators
- SVN
- Tibero
- String Function and Operators
- Oracle
- Sring Functions and Operators
- Today
- Total
목록Date and Time Functions (54)
웹이야기
MySQL 날짜함수, 시간함수 PERIOD_ADD() - 날짜에 달(월)을 더해주는 함수 PERIOD_ADD(P, N) 의 형태 Adds N months to period P(int the format YYMM or YYYYMM). Returns a value in the foramt YYYYMM. The period argument P is niot a date value. mysql> SELECT PERIOD_ADD(202001, 2); +-----------------------+ | PERIOD_ADD(202001, 2) | +-----------------------+ | 202003 | +-----------------------+ 1 row in set (0.00 sec)
MySQL 날짜함수, 시간함수 NOW() - 현재 날짜와 시간을 구하는 함수. NOW([fsp]) 의 형태 Returns the current date and the time as a value in 'YYYY-MM-DD hh:mm:ss' or YYYYMMDDhhmmss format, depending on whether the function is used in string or numeric context. The value is expressed in the session time zone. If the fsp argument is given to specify a fractional seconds precision from i to 6, the return value includes a fract..
MySQL 날짜함수, 시간함수 MONTHNAME() - 달의 이름을 구해준다. MONTHNAME(date) 의 형태 Returns the full name of the month for date. The language used for the name is controlled by the value of the lc_time_names system variables. mysql> SELECT MONTHNAME(NOW()); +------------------+ | MONTHNAME(NOW()) | +------------------+ | April | +------------------+ 1 row in set (0.00 sec) mysql> SELECT MONTHNAME('202-00-00'); +--..
MySQL 날짜함수, 시간함수 MONTH() - 주어진 날짜로부터 월을 구해준다. MONTH(date) 의 형태로 사용 Returns the month for date, in the range 1 to 12 for January to December, or 0 for dates such as '0000-00-00' or '2008-00-00' that hava a zero month part. mysql> SELECT MONTH(NOW()); +--------------+ | MONTH(NOW()) | +--------------+ | 4 | +--------------+ 1 row in set (0.00 sec) mysql> SELECT MONTH('2020-11-11'); +--------------..
MySQL 날짜함수, 시간함수 MINUTE() - 시간으로부터 분(minute)을 구하는 함수 MINUTE(time) 의 형태 Returns the minute for time, in the range of 0 to 59. mysql> SELECT MINUTE(NOW()); +---------------+ | MINUTE(NOW()) | +---------------+ | 42 | +---------------+ 1 row in set (0.00 sec) mysql> SELECT MINUTE('11:45'); +-----------------+ | MINUTE('11:45') | +-----------------+ | 45 | +-----------------+ 1 row in set (0.00 sec)
MySQL 날짜함수, 시간함수 MICROSECOND() - 시간으로부터 microsecond 를 return 해준다. MICROSECOND(expr) 의 형태 Returns the microseconds from the time or datetime expression expr as a number in the range from 0 to 999999. mysql> SELECT MICROSECOND(NOW()); +--------------------+ | MICROSECOND(NOW()) | +--------------------+ | 0 | +--------------------+ 1 row in set (0.00 sec) mysql> SELECT MICROSECOND('2019-02-02 :12;3..
MySQL 날짜함수, 시간함수 MAKETIME() - 주어진 값으로 시간(time)을 return? MAKETIME(hour, minute, second) 의 형태 Returns a time value calculated from the hour, minute, and second arguments. The second argument can have a fractional part. mysql> SELECT MAKETIME(12, 15, 30); +----------------------+ | MAKETIME(12, 15, 30) | +----------------------+ | 12:15:30 | +----------------------+ 1 row in set (0.00 sec) mysql> S..
MySQL 날짜함수, 시간함수 MAKEDATE() - 주어진 값으로 날짜를 생성? MAKEDATE(year, dayofyear) 의 형태 Return a date, given year and day-of-year values, dayofyear must be greater tnan 0 or result is NULL. mysql> SELECT MAKEDATE(2011, 31), MAKEDATE(2011, 32); +--------------------+--------------------+ | MAKEDATE(2011, 31) | MAKEDATE(2011, 32) | +--------------------+--------------------+ | 2011-01-31 | 2011-02-01 | +----..
MySQL 날짜함수, 시간함수 LOCALTIME() - LOCALTIME, LOCALTIME([fsp]) 의 형태 LOCALTIME AND LOCALTIME() are synonyms for NOW() mysql> SELECT LOCALTIME; +---------------------+ | LOCALTIME | +---------------------+ | 2020-04-02 13:00:10 | +---------------------+ 1 row in set (0.00 sec) mysql> SELECT LOCALTIME(); +---------------------+ | LOCALTIME() | +---------------------+ | 2020-04-02 13:00:14 | +----------..
MySQL 날짜함수, 시간함수 LAST_DAY() - 해당 월의 마지막 날짜를 return. LAST_DAY(date), LAST_DAY(datetime) 의 형태 Takes a date or datetime value and returns the corresponding value for the last day of the month. Return NULL if the argument is invalid. mysql> SELECT LAST_DAY(NOW()); +-----------------+ | LAST_DAY(NOW()) | +-----------------+ | 2020-04-30 | +-----------------+ 1 row in set (0.00 sec) mysql> SELECT LAST..
MySQL 날짜함수, 시간함수 HOUR() - 시간에 대한 시 값을 알려준다. (HOUR) HOUR(time) 의 형태 Returns the hour for time. The range of return value is 0 to 23 for time-of-day values. Howerer the range of TIME values actually is much larger, so HOUR can return values greater than 23. mysql> SELECT HOUR(NOW()); +-------------+ | HOUR(NOW()) | +-------------+ | 12 | +-------------+ 1 row in set (0.00 sec) mysql> SELECT HOUR('..
MySQL 날짜함수, 시간함수 GET_FORMAT() - GET_FORMAT({ DATE | TIME | DATETIME }, { 'EUR' | 'USA' | 'JSI' | 'ISO' | 'INTERVAL'}) Returns a format string. This function useful in combination with the DATE_FOMRAT() and the STR_TO_DATE() functions. The possible values for the first and second arguments result in serveral possible format strings. ISO format refers to ISO 9075, not ISO 8601 흠.. 나머진 생략 mysql> SE..
MySQL 날짜함수, 시간함수 FROM_UNIXTIME() - unix_timestamp 를 날짜로 바꿔준다라고 보면 되겠다. - UNIX_TIMESTAMP() 와 반대의 개념 FROM_UNIXTIME(unix_timestamp[, format]) 의 형태 Returns a representation of the unix_timestamp argument as a value in 'YYYY-MM-DD hh:mm:ss' or YYYYMMDDhhmmss format, depending on whether the function is used in a string or numeric context. unix_timestamp is an internal timestamp value representing sec..
MySQL 날짜함수, 시간함수 FROM_DAYS() - 숫자를 DATE 형태로 return 해준다. FROM_DAYS(N) Given a day number N, returns a DATE value. Use FROM_DAYS() with caution on old dates. It is not intended for use with values that precede the advent of the Gregorian calendar(1582). mysql> SELECT FROM_DAYS(100) ; +----------------+ | FROM_DAYS(100) | +----------------+ | 0000-00-00 | +----------------+ 1 row in set (0.00 sec) ..
MySQL 날짜함수, 시간함수 EXTRACT() - 날짜에서 년, 월, 일, 시간등을 추출 EXTRACT(unit FROM date) 의 형태 The EXTRACT() function uses the same kinds of unit specifiers as DATE_ADD() or DATE_SUB(), but extracts parts from the date rather than performing date arithmetic. unit 으로 쓸 수 있는 것들 unit value Expected expr Format MICROSECOND MICROSECONDS SECOND SECONDS MINUTE MINUTES HOUR HOURS DAY DAYS WEEK WEEKS MONTH MONTHS QUART..
MySQL 날짜함수, 시간함수 DAYOFYEAR() - 년을 기준으로 해서 몇번째 일인지를 return. DAYOFYEAR(date) Retruns the day of the year for date, in the range 1 to 366. mysql> SELECT DAYOFYEAR(NOW()); +------------------+ | DAYOFYEAR(NOW()) | +------------------+ | 92 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT DAYOFYEAR('2020-01-01'); +-------------------------+ | DAYOFYEAR('2020-01-01') | +-------------------..
MySQL 날짜함수, 시간함수 DAYOFWEEK() - 주의 몇번째(weekday index) 인지를 return. DAYOFWEEK(date) Returns the weekday index for date(1=Sunday, 2=Monday.... 7=Saturday). These index value correspond to the ODBC standard. mysql> SELECT DAYOFWEEK(NOW()); +------------------+ | DAYOFWEEK(NOW()) | +------------------+ | 4 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT DAYOFWEEK('2020-04-01'); +---------..
MySQL 날짜함수, 시간함수 DAYOFMONTH() - 몇일인지를 return. DAYOFMONTH(date) 의 형태 Returns the day of the month for date, in the range 1 to 31, or 0 for dates such as '0000-00-00' or '2008-00-00') that have a zero day part. mysql> SELECT DAYOFMONTH(NOW()); +-------------------+ | DAYOFMONTH(NOW()) | +-------------------+ | 1 | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT DAYOFMONTH('2010-05-10')..
MySQL 날짜함수, 시간함수 DAYNAME() - weekday의 이름을 return. DAYNAME(date) 의 형태 Returns the name of the weekday for date. The language used for the name is controlled by the value of the lc_time_names system variable. mysql> SELECT DAYNAME('2020-03-01') ; +-----------------------+ | DAYNAME('2020-03-01') | +-----------------------+ | Sunday | +-----------------------+ 1 row in set (0.00 sec) mysql> SELECT ..
MySQL 날짜함수, 시간함수 DAY() DAY(date) 의 형태로 사용 DAY() is a synonym for DAYOFMONTH(); https://webobj.tistory.com/119 MySQL DAYOFMONTH() MySQL 날짜함수, 시간함수 DAYOFMONTH() - 몇일인지를 return. DAYOFMONTH(date) 의 형태 Returns the day of the month for date, in the range 1 to 31, or 0 for dates such as '0000-00-00' or '2008-00-00').. webobj.tistory.com