MySQL Date/Time second() Function17 Mar 2025 | 1 min read The second() is a MySQL date/time function. It is used to get the second portion from the given date/datetime. SyntaxParameter:date_value : date/datetime value for getting second. Returns:This function returns the second portion of a date value. Example 1Output: ![]() Example 2Output: ![]() Next TopicMySQL datetime |
MySQL DATE_FORMAT() Function The date_format() is a MySQL date/time function. It is used to get the date in specified format. Syntax select date_format(date, format_mask) Parameter: Date: date to be formatted Format_mask: format to be applied in date, following is the list of all the formats. Value Description %a Weekday name abbreviated (Sun to Sat) %b Month name abbreviated...
2 min read
MySQL Date/Time str_to_date() Function The str_to_date() is a MySQL date/time function. It is used to convert the string into given format_mask. Syntax select str_to_date(string, format_mask); Parameter: String : string value to get date format_mask : format to be applied, following are the different formats. Value Description %a Weekday name abbreviated (Sun to Sat) %b Month name abbreviated (Jan...
2 min read
MySQL Date/Time weekofyear() Function The weekofyear() is a MySQL date/time function. It is used to get the week of the given date. Syntax select weekofyear(date_value); Parameter: Date_value : date for getting weekofyear Returns: This function returns week of the year for a date value. Example 1 select weekofyear('2018-10-03'); Output: Example 2 select weekofyear('1995-02-11'); Output: TopicMySQL datetime ...
1 min read
MySQL Date/Time now() Function The now() is a MySQL date/time function. It is used to get the current date and time. Syntax select now(); Returns: This function returns the current date and time. Example 1 Select now(); Output: Example 2 Select now()+1; Output: TopicMySQL datetime ...
1 min read
MySQL Date/Time sec_to_time() Function The sec_to_time() is a MySQL date/time function. It is used to convert the given second into time. Syntax select sec_to_time(second); Parameter: Second : second value to get time. Example 1 select sec_to_time(2000); Output: Example 2 select sec_to_time(40); Output: TopicMySQL datetime ...
1 min read
MySQL Date/Time period_diff() Function The period_diff() is a MySQL date/time function. It is used to get the difference between two given periods. Syntax select period_diff(period1, period2); Parameter: period1 : period value in formate YYMM or YYYYMM. period2 : period value in formate YYMM or YYYYMM. Returns: This function returns the difference in months between...
1 min read
MySQL DAYOFWEEK() Function The dayofweek() is a MySQL date/time function. It is used to get the day of the week in numeric. Syntax select dayofweek(date); Parameter: Date: date value for getting a day of the week. Returns: This function returns the weekday index for a date value. Example 1 Select dayofweek('2018-09-26'); Output: Example 2 Select dayofweek('2018-5-12'); Output: TopicMySQL date/time ...
1 min read
MySQL DATE_ADD() Function The date_add() is a MySQL date/time function. It is used to get the date in which some date/datetime intervals are added. Syntax select date_add(date, interval value unit); Parameter: Date: date in which interval will be added Value: date/time intervals Unit: type of interval which are as following: Unit Compatibility MICROSECOND 4.1.1+ SECOND 3.2.3+ MINUTE 3.2.3+ HOUR 3.2.3+ DAY 3.2.3+ WEEK 5+ MONTH 3.2.3+ QUARTER 5+ YEAR 3.2.3+ SECOND_MICROSECOND 4.1.1+ MINUTE_MICROSECOND 4.1.1+ MINUTE_SECOND 4.1.1+ HOUR_MICROSECOND 4.1.1+ HOUR_SECOND 4.1.1+ HOUR_MINUTE 3.2.3+ DAY_MICROSECOND 4.1.1+ DAY_SECOND 3.2.3+ DAY_MINUTE 3.2.3+ DAY_HOUR 3.2.3+ YEAR_MONTH 3.2.3+ Returns This function will return...
1 min read
MySQL CURTIME() Function The curtime() is a MySQL date/time function. It is used to get the current time. Syntax select curtime(); Parameters NA Returns This function will return the current time. Example 1 Select curtime(); Output: Example 2 Select curtime()+2; Output: TopicMySQL date/time ...
1 min read
MySQL Date/Time maketime() Function The maketime() is a MySQL date/time function. It is used to make the time from given hour, minute and second. Syntax select maketime(hour, minute, second); Parameter: hour: hour value for making time minute: minute value for making time second: second value for making time Returns: This function returns the time for...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India