HOUR() and FROM_DAYS() function in MariaDB Last Updated : 15 Dec, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 1. HOUR() Function : In MariaDB, the HOUR() function is used to return the hour portion of a date value. In this function, the first parameter will be date_value. This function will return HOUR part of the given date. Since a time value can be range from -838:59:59' to '838:59:59' so that this function can return values 0 to up to 838. Syntax : HOUR(date_value) Parameter : date_value - A DateTime value from which hour portion will be extracted. Returns : The Hour part from a date. Example-1 : SELECT HOUR('2020-05-09 06:11:18.000004'); Output : 6 Example-2 : SELECT HOUR('837:56:52'); Output : 837 Example-3 : SELECT HOUR('2018-02-11 11:19:01'); Output : 11 Example-4 : SELECT HOUR('10:02:06'); Output : 10 Example-5 : Current system time is returned by the CURTIME() function. SELECT HOUR(CURTIME()); Output : 8 2. FROM_DAYS() Function: In MariaDB, the FROM_DAYS() function is used to convert a numeric day into a date value. In this function, the first parameter will be a date. This function will convert a given numeric to date. This function is to be used only with dates within the Gregorian calendar. Syntax : FROM_DAYS(date) Parameter : date - date(numeric) which will be converted in date value. Returns : The date value. Example-1 : SELECT FROM_DAYS(735919) ; Output : '2014-11-17' Example-2 : SELECT (FROM_DAYS(780500)- FROM_DAYS(780500)); Output : 0 Example-3 : SELECT FROM_DAYS(735910); Output : '2014-11-08' Comment More infoAdvertise with us Next Article HOUR() and FROM_DAYS() function in MariaDB V vipinyadav15799 Follow Improve Article Tags : SQL DBMS-SQL Similar Reads TO_DAYS Function and WEEK Function in MariaDB TO_DAYS Function : In MariaDB, TO_DAYS Function converts a date into numeric days. In this function, the first parameter will be the Date. This function returns the numeric days of the date. This function is to be used only with dates within the Gregorian calendar. This function will return NULL if 2 min read DATE_FORMAT() Function in MariaDB DATE_FORMAT() Function : In MariaDB, the DATE_FORMAT() function uses two parameters - a date as specified by a format mask. In this function, the first parameter will be a date and the second parameter will be the mask. This function will return the date in the given mask. This function will convert 3 min read EXTRACT() and DAYOFYEAR() Function in MariaDB 1. EXTRACT() Function : In MariaDB, the EXTRACT() function is used to return extracts the extracts parts from a date. In this function, the first parameter will be an expression. The first part of expression will be unit and second part of expression will be a date. This function will return extract 2 min read DATE() and DATE_ADD() Function in MariaDB 1. DATE() Function : In MariaDB, the DATE() function is used to return extracts the date value from a date or datetime expression. In this function, the first parameter will be a date or DateTime. This function will return extracts the date value from the expression. If the expression is not date or 2 min read Day() and Hour() Function in MS Access 1. Day() Function : Day() function returns the day of the month for a given date. In this function, it will take a date as a parameter and it will return the day of that date. The returned day will between 1 to 31. Syntax : Day(date) Example-1 : SELECT Day(#02/23/2020#); Output - 23 Example-2 : SELE 1 min read Like