{"id":2573,"date":"2010-05-19T23:35:16","date_gmt":"2010-05-20T07:35:16","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=2573"},"modified":"2023-10-16T19:17:33","modified_gmt":"2023-10-17T02:17:33","slug":"mysql-date_format","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-date-functions\/mysql-date_format\/","title":{"rendered":"MySQL DATE_FORMAT() Function"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the MySQL <code>DATE_FORMAT()<\/code><strong> <\/strong>function to format a date value based on a specific format.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to MySQL DATE_FORMAT function<\/h2>\n\n\n\n<p>To format a <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-date\/\">date<\/a> value to a specific format, you use the <code>DATE_FORMAT()<\/code> function. The syntax of the <code>DATE_FORMAT<\/code> function is as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">DATE_FORMAT(date,format)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>DATE_FORMAT()<\/code> function accepts two arguments:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>date<\/code> : is a valid date value that you want to format<\/li>\n\n\n\n<li><code>format<\/code> : is a format string that consists of predefined specifiers. Each specifier is preceded by a percentage character ( <code>%<\/code> ). See the table below for a list of predefined specifiers.<\/li>\n<\/ul>\n\n\n\n<p>The <code>DATE_FORMAT<\/code> function returns a string whose <a title=\"MySQL Character Set\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-character-set\/\">character set<\/a> and <a title=\"MySQL Collation\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-collation\/\">collation<\/a> depend on the settings of the client&#8217;s connection.<\/p>\n\n\n\n<p>The following table illustrates the specifiers and their meanings that you can use to construct a date format string:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Specifier<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>%a<\/td><td>Three-characters abbreviated weekday name e.g., Mon, Tue, Wed, etc.<\/td><\/tr><tr><td>%b<\/td><td>Three-characters abbreviated month name e.g., Jan, Feb, Mar, etc.<\/td><\/tr><tr><td>%c<\/td><td>Month in numeric e.g., 1, 2, 3&#8230;12<\/td><\/tr><tr><td>%D<\/td><td>Week number with leading zero when the first day of the week is Sunday e.g., 00,01,02&#8230;53<\/td><\/tr><tr><td>%d<\/td><td>Day of the month with leading zero if it is 1 number e.g., 00, 01,02, &#8230;31<\/td><\/tr><tr><td>%e<\/td><td>Day of the month without leading zero e.g., 1,2,&#8230;31<\/td><\/tr><tr><td>%f<\/td><td>Microseconds in the range of 000000..999999<\/td><\/tr><tr><td>%H<\/td><td>Hour in 24-hour format with leading zero e.g., 00..23<\/td><\/tr><tr><td>%h<\/td><td>Hour in 12-hour format with leading zero e.g., 01, 02&#8230;12<\/td><\/tr><tr><td>%I<\/td><td>Same as %h<\/td><\/tr><tr><td>%i<\/td><td>Minutes with leading zero e.g., 00, 01,&#8230;59<\/td><\/tr><tr><td>%j<\/td><td>Day of year with leading zero e.g., 001,002,&#8230;366<\/td><\/tr><tr><td>%k<\/td><td>Hour in 24-hour format without leading zero e.g., 0,1,2&#8230;23<\/td><\/tr><tr><td>%l<\/td><td>Hour in 12-hour format without leading zero e.g., 1,2&#8230;12<\/td><\/tr><tr><td>%M<\/td><td>Full month name e.g., January, February,&#8230;December<\/td><\/tr><tr><td>%m<\/td><td>Month name with leading zero e.g., 00,01,02,&#8230;12<\/td><\/tr><tr><td>%p<\/td><td>AM or PM, depending on other time specifiers<\/td><\/tr><tr><td>%r<\/td><td>Time in 12-hour format hh:mm:ss AM or PM<\/td><\/tr><tr><td>%S<\/td><td>Seconds with leading zero 00,01,&#8230;59<\/td><\/tr><tr><td>%s<\/td><td>Same as %S<\/td><\/tr><tr><td>%T<\/td><td>Time in 24-hour format hh:mm:ss<\/td><\/tr><tr><td>%U<\/td><td>Weekday in number (0=Sunday, 1= Monday, etc.)<\/td><\/tr><tr><td>%u<\/td><td>Week number with leading zero when the first day of the week is Monday e.g., 00,01,02&#8230;53<\/td><\/tr><tr><td>%V<\/td><td>Same as %U; it is used with %X<\/td><\/tr><tr><td>%v<\/td><td>Same as %u; it is used with %x<\/td><\/tr><tr><td>%W<\/td><td>Full name of weekday e.g., Sunday, Monday,&#8230;, Saturday<\/td><\/tr><tr><td>%w<\/td><td>Two digits year e.g., 10,11, and 12.<\/td><\/tr><tr><td>%X<\/td><td>Year for the week in four digits where the first day of the week is Sunday; often used with %V<\/td><\/tr><tr><td>%x<\/td><td>Year for the week, where the first day of the week is Monday, four digits; used with %v<\/td><\/tr><tr><td>%Y<\/td><td>Four digits year e.g., 2000 and 2001.<\/td><\/tr><tr><td>%y<\/td><td>Add a percentage (%) character to the output<\/td><\/tr><tr><td>%%<\/td><td>Add percentage (%) character to the output<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The following are some commonly used date format strings:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>DATE_FORMAT string<\/th><th>Formatted date<\/th><\/tr><\/thead><tbody><tr><td>%Y-%m-%d<\/td><td>2013-07-04<\/td><\/tr><tr><td>%e\/%c\/%Y<\/td><td>4\/7\/2013<\/td><\/tr><tr><td>%c\/%e\/%Y<\/td><td>7\/4\/2013<\/td><\/tr><tr><td>%d\/%m\/%Y<\/td><td>4\/7\/2013<\/td><\/tr><tr><td>%m\/%d\/%Y<\/td><td>7\/4\/2013<\/td><\/tr><tr><td>%e\/%c\/%Y %H:%i<\/td><td>4\/7\/2013 11:20<\/td><\/tr><tr><td>%c\/%e\/%Y %H:%i<\/td><td>7\/4\/2013 11:20<\/td><\/tr><tr><td>%d\/%m\/%Y %H:%i<\/td><td>4\/7\/2013 11:20<\/td><\/tr><tr><td>%m\/%d\/%Y %H:%i<\/td><td>7\/4\/2013 11:20<\/td><\/tr><tr><td>%e\/%c\/%Y %T<\/td><td>4\/7\/2013 11:20<\/td><\/tr><tr><td>%c\/%e\/%Y %T<\/td><td>7\/4\/2013 11:20<\/td><\/tr><tr><td>%d\/%m\/%Y %T<\/td><td>4\/7\/2013 11:20<\/td><\/tr><tr><td>%m\/%d\/%Y %T<\/td><td>7\/4\/2013 11:20<\/td><\/tr><tr><td>%a %D %b %Y<\/td><td>Thu 4th Jul 2013<\/td><\/tr><tr><td>%a %D %b %Y %H:%i<\/td><td>Thu 4th Jul 2013 11:20<\/td><\/tr><tr><td>%a %D %b %Y %T<\/td><td>Thu 4th Jul 2013 11:20:05<\/td><\/tr><tr><td>%a %b %e %Y<\/td><td>Thu Jul 4 2013<\/td><\/tr><tr><td>%a %b %e %Y %H:%i<\/td><td>Thu Jul 4 2013 11:20<\/td><\/tr><tr><td>%a %b %e %Y %T<\/td><td>Thu Jul 4 2013 11:20:05<\/td><\/tr><tr><td>%W %D %M %Y<\/td><td>Thursday 4th July 2013<\/td><\/tr><tr><td>%W %D %M %Y %H:%i<\/td><td>Thursday 4th July 2013 11:20<\/td><\/tr><tr><td>%W %D %M %Y %T<\/td><td>Thursday 4th July 2013 11:20:05<\/td><\/tr><tr><td>%l:%i %p %b %e, %Y<\/td><td>7\/4\/2013 11:20<\/td><\/tr><tr><td>%M %e, %Y<\/td><td>4-Jul-13<\/td><\/tr><tr><td>%a, %d %b %Y %T<\/td><td>Thu, 04 Jul 2013 11:20:05<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL DATE_FORMAT examples<\/h2>\n\n\n\n<p>Let&#8217;s take a look at the <code>orders<\/code> table in the <a title=\"MySQL Sample Database\" href=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\">sample database<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg\" alt=\"\" class=\"wp-image-10769\"\/><\/figure>\n\n\n\n<p>To select the order&#8217;s data and format the date value, you use the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    orderNumber,\n    <span class=\"hljs-keyword\">DATE_FORMAT<\/span>(orderdate, <span class=\"hljs-string\">'%Y-%m-%d'<\/span>) orderDate,\n    <span class=\"hljs-keyword\">DATE_FORMAT<\/span>(requireddate, <span class=\"hljs-string\">'%a %D %b %Y'<\/span>) requireddate,\n    <span class=\"hljs-keyword\">DATE_FORMAT<\/span>(shippedDate, <span class=\"hljs-string\">'%W %D %M %Y'<\/span>) shippedDate\n<span class=\"hljs-keyword\">FROM<\/span>\n    orders;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-date_format\/#1\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"178\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2010\/05\/MySQL-DATE_FORMAT-Function-Order-Table-Example.jpg\" alt=\"MySQL DATE_FORMAT Function Orders Table Example\" class=\"wp-image-4616\" title=\"MySQL DATE_FORMAT Function Orders Table Example\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2010\/05\/MySQL-DATE_FORMAT-Function-Order-Table-Example.jpg 456w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2010\/05\/MySQL-DATE_FORMAT-Function-Order-Table-Example-300x117.jpg 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/figure>\n\n\n\n<p>We formatted the order date, required date, and shipped date of each order based on different date formats specified by the format strings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MySQL DATE_FORMAT with ORDER BY<\/h3>\n\n\n\n<p>See the following example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    orderNumber,\n    <span class=\"hljs-keyword\">DATE_FORMAT<\/span>(shippeddate, <span class=\"hljs-string\">'%W %D %M %Y'<\/span>) shippeddate\n<span class=\"hljs-keyword\">FROM<\/span>\n    orders\n<span class=\"hljs-keyword\">WHERE<\/span>\n    shippeddate <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> shippeddate;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-date_format\/#2\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"251\" height=\"177\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2010\/05\/MysQL-DATE_FORMAT-with-ORDER-BY-clause-example.jpg\" alt=\"MysQL DATE_FORMAT with ORDER BY clause example\" class=\"wp-image-4617\" title=\"MysQL DATE_FORMAT with ORDER BY clause example\"\/><\/figure>\n\n\n\n<p>In the query, we selected all orders whose shipped dates were not <code>NULL<\/code> and sorted the orders by the shipped date. However, the orders were not sorted correctly.<\/p>\n\n\n\n<p>The reason is that we used <code>shippeddate<\/code> as the <a title=\"MySQL Alias\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-alias\/\">alias <\/a>for the output of the <code>DATE_FORMAT<\/code> function, which is a string, the <a title=\"MySQL ORDER BY\" href=\"https:\/\/www.mysqltutorial.org\/mysql-order-by\">ORDER BY<\/a> clause took the alias and sorted the orders based on string values, not date values.<\/p>\n\n\n\n<p>To fix this problem, we have to use an alias that is different from the column name; see the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    orderNumber,\n    <span class=\"hljs-keyword\">DATE_FORMAT<\/span>(shippeddate, <span class=\"hljs-string\">'%W %D %M %Y'<\/span>) <span class=\"hljs-string\">'Shipped date'<\/span>\n<span class=\"hljs-keyword\">FROM<\/span>\n    orders\n<span class=\"hljs-keyword\">WHERE<\/span>\n    shippeddate <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> shippeddate;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-date_format\/#3\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"278\" height=\"176\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2010\/05\/MysQL-DATE_FORMAT-with-ORDER-BY-clause.jpg\" alt=\"MysQL DATE_FORMAT with ORDER BY clause\" class=\"wp-image-4618\" title=\"MysQL DATE_FORMAT with ORDER BY clause\"\/><\/figure>\n\n\n\n<p>In this tutorial, we have shown you how to use the MySQL <code>DATE_FORMAT<\/code> function to format the date based on a specified format.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"2573\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-date-functions\/mysql-date_format\/\"\n\t\t\t\tdata-post-title=\"MySQL DATE_FORMAT() Function\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"2573\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-date-functions\/mysql-date_format\/\"\n\t\t\t\tdata-post-title=\"MySQL DATE_FORMAT() Function\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":7032,"menu_order":22,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-2573","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL DATE_FORMAT() Function<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mysqltutorial.org\/mysql-date_format\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL DATE_FORMAT() Function\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/mysql-date_format\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-17T02:17:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/\",\"name\":\"MySQL DATE_FORMAT() Function\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/orders.svg\",\"datePublished\":\"2010-05-20T07:35:16+00:00\",\"dateModified\":\"2023-10-17T02:17:33+00:00\",\"description\":\"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/orders.svg\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/orders.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date_format\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Date Functions\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-date-functions\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MySQL DATE_FORMAT() Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL DATE_FORMAT() Function","description":"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/","og_locale":"en_US","og_type":"article","og_title":"MySQL DATE_FORMAT() Function","og_description":"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.","og_url":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-10-17T02:17:33+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/","url":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/","name":"MySQL DATE_FORMAT() Function","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg","datePublished":"2010-05-20T07:35:16+00:00","dateModified":"2023-10-17T02:17:33+00:00","description":"This tutorial shows you how to use the MySQL DATE_FORMAT function to format a date value based on a specific format.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/mysql-date_format\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/orders.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/mysql-date_format\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"MySQL Date Functions","item":"https:\/\/www.mysqltutorial.org\/mysql-date-functions\/"},{"@type":"ListItem","position":3,"name":"MySQL DATE_FORMAT() Function"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=2573"}],"version-history":[{"count":3,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2573\/revisions"}],"predecessor-version":[{"id":11295,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/2573\/revisions\/11295"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/7032"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=2573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}