MySQL Date/Time to_day() Function17 Mar 2025 | 1 min read The to_days() is a MySQL date/time function. It is used to convert the date into numeric number of days. SyntaxParameter:Date : date to be converted into number of days. Example 1Output: ![]() Example 2Output: ![]() Next TopicMySQL datetime |
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_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 CURRENT_TIMESTAMP() Function The current_timestamp() is a MySQL date/time function. It is used to get the current date and time. Syntax select current_timestamp(); Parameter NA Returns The current_timestamp function returns the current date and time. It will return the current date as a 'YYYY-MM-DD HH:MM:SS' format if used in a string context. It...
1 min read
MySQL Date/Time second() Function The second() is a MySQL date/time function. It is used to get the second portion from the given date/datetime. Syntax select second(date_value); Parameter: date_value : date/datetime value for getting second. Returns: This function returns the second portion of a date value. Example 1 Select second('2018-09-29 01:21:24.000002'); Output: Example 2 select second('02:25:24.000004'); Output: TopicMySQL datetime ...
1 min read
MySQL Date/Time weekday() Function The weekday() is a MySQL date/time function. It is used to get the index for a date. Syntax select weekday(date_value); Parameter: Date_value : date for getting weekday Returns: This function returns the weekday index for a date. Example 1 select weekday('2018-10-03'); Output: Example 2 select weekday('1995-02-11'); Output: TopicMySQL datetime ...
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
MySQL Date/Time last_day() Function The last_day() is a MySQL date/time function that accepts date or datetime value only. It is used to get the last day of the given month for the input date. If we provide an invalid input date or datetime, it always returns a...
2 min read
MySQL Date/Time Subdate() Function The subdate() is a MySQL date/time function. It is used to get the date which is subtracted by given intervals. Syntax Select subdate(date, interval value unit); kOr Select subdate(date, days); Parameter Date : date by which interval is to be subtracted. Days : number of days in which...
1 min read
MySQL From_days() Function The from_days() is a MySQL date/time function. It is used to get the date of the given number of days. Syntax select from_days(numeric_day); Parameter: Numeric: value to convert in date. Example 1 Select from_days(756982); Output: Example 2 Select from_days(456982); Output: TopicMySQL date/time ...
1 min read
MySQL ADDTIME() Function The addtime() is a MySQL date/time function. It is used to get time/datetime value in which some time intervals are added. Syntax select addtime(start_value, time) Parameter start_value: value for time or datetime in which time is added. time: value for time is as per user requirement. Returns This function returns the...
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