content_image/795662.jpg
<img src='content_image/795662.jpg'>

TIMESTAMP  can also be used as the first argument to GET_FORMAT() , in which case the function returns the same values as for DATETIME . 

mysql> SELECT DATE_FORMAT(’2003-10-03’,GET_FORMAT(DATE,’EUR’)); -> ’03.10.2003’ mysql> SELECT STR_TO_DATE(’10.31.2003’,GET_FORMAT(DATE,’USA’)); -> ’2003-10-31’ 

• HOUR( time ) 

Returns the hour for time . The range of the return value is 0  to 23  for time-of-day values. However, the range of TIME  values actually is much larger, so HOUR  can return values greater than 23 . 

mysql> SELECT HOUR(’10:05:03’); -> 10 mysql> SELECT HOUR(’272:59:59’); -> 272 

• LAST_DAY( date ) 

Takes a date or datetime value and returns the corresponding value for the last day of the month. Returns NULL  if the argument is invalid. 

mysql> SELECT LAST_DAY(’2003-02-05’); -> ’2003-02-28’ mysql> SELECT LAST_DAY(’2004-02-05’); -> ’2004-02-29’ mysql> SELECT LAST_DAY(’2004-01-01 01:01:01’); -> ’2004-01-31’ mysql> SELECT LAST_DAY(’2003-03-32’); -> NULL 

• LOCALTIME , LOCALTIME([ fsp ]) 

LOCALTIME  and LOCALTIME()  are synonyms for NOW() . 

• LOCALTIMESTAMP , LOCALTIMESTAMP([ fsp ]) 

LOCALTIMESTAMP  and LOCALTIMESTAMP()  are synonyms for NOW() . 

• MAKEDATE( year , dayofyear ) 

Returns a date, given year and day-of-year values. dayofyear  must be greater than 0 or the result is NULL . 

mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32); -> ’2011-01-31’, ’2011-02-01’ mysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365); -> ’2011-12-31’, ’2014-12-31’ mysql> SELECT MAKEDATE(2011,0); -> NULL 

• 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); 

