MySQL में date से साथ काम करने के लिए बहुत सारे functions और keywords provide किये हैं , जिनका use हम अपनी need के according कर सकते हैं।

इस topic में हम उन सभी date functions के बारे में जानेंगे -

FunctionDescription

CURDATE

यह current date return करता है।

DATEDIFF

यह दो dates के बीच के number of days return करता है।

DAY

यह function pass की गयी date से day return करता है।

DATE_ADD

इस function का use time value को date में add करने के लिए use किया है।

DATE_SUB

इस function का use time value को date से substract (घटाने) के लिए use किया है।

DATE_FORMAT

इस function का use करके हम date format को need के according change कर सकते हैं।

DAYNAME

इस function का use किसी date से day name get करने के लिए किया जाता है ।

DAYOFWEEK

इसका use किसी date से weekday index get करने के लिए किया जाता है ।

NOW

यह function current date और time को return करता है।

MONTH

यह function एक integer value return करता है जो specified date का month होता है।

WEEK

यह किसी date का week number return करता है।

YEAR

यह किसी date से year return करता है।

By default MySQL में date का format YYYY-MM-DD होता है , तो अगर आपको different format में date चाहिए तो उसका format change करना पड़ेगा।

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook

b2eprogrammers