YYYY-MM-DD is the best, IMHO. You can do a simple alpha sort on it to get a chronological sort, and you will never confuse it. MM-DD-YYYY will often be confused with DD-MM-YYYY. (As an American, I'm for all forms of Freedom Units except for this one.) Also, and alpha sort doesn't work on it. Answer from Hobadee on reddit.com
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › base-types › standard-date-and-time-format-strings
Standard date and time format strings - .NET | Microsoft Learn
A standard date and time format string uses a single character as the format specifier to define the text representation of a DateTime, DateTimeOffset, DateOnly, or TimeOnly value. Any date and time format string that contains more than one character, including white space, is interpreted as a custom date and time format string.
🌐
Code Institute
codeinstitute.net › blog › coding › date formats in coding
Date Formats in Code - PHP, Javascript, SQL & More - Code Institute Global
October 25, 2022 - Because of the vast disparities in time zones, programmers incorporate date functions in their programs to represent the data in the computer’s local time zone. The date format in which the data is recorded on a computer, on the other hand, is typically unorganised and difficult to comprehend, which is why date formats exist.
🌐
Unicode
unicode-org.github.io › icu › userguide › format_parse › datetime
Formatting Dates and Times | ICU Documentation
It formats or parses a date or time, which is the standard milliseconds since 24:00 GMT, Jan. 1, 1970. SimpleDateFormat is the only built-in implementation of DateFormat. It provides a programmable interface that can be used to produce formatted dates and times in a wide variety of formats.
🌐
Devhints
devhints.io › others › date & time formats cheatsheet
Date & time formats cheatsheet
The one-page guide to Date & time formats: usage, examples, links, snippets, and more.
🌐
Reddit
reddit.com › r/informationtechnology › is there a preferred date format for programming and databases?
r/InformationTechnology on Reddit: Is there a preferred date format for programming and databases?
November 17, 2020 -

I have been doing PHP and MySQL for 15+ years and have always used YYYY-MM-DD for any dates that are going to be stored or processed. I have started learning javascript, but haven't worked much with dates. I am currently working on an Oracle class and it is usually using MM-DD-YYYY.

I'm just wondering if there is a preferred date format to use across languages and platforms? Is there a particular reason why one format might be preferable to others?

For what it's worth, YYYY-MM-DD is what I always saw in my PHP training, and it's also the most logical format (in my opinion) to use for file naming.

🌐
Oracle
docs.oracle.com › cd › E41183_01 › DR › Date_Format_Types.html
Date Format Types
You are here: Function Reference > Date Functions > Date Formats > Date Format Types
🌐
Hyperskill
hyperskill.org › learn › step › 31623
Date and time formatting
Hyperskill is an educational platform for learning programming and software development through project-based courses, that helps you secure a job in tech. Master Python, Java, Kotlin, and more with real-world coding challenges.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Guides › Date_and_time_formats
Using date and time formats in HTML - HTML | MDN
<!--midnight of January 1st, 10000: the exact time of Y10K--> <input type="datetime-local" value="+010000-01-01T05:00" /> We need to prepare our code for any number of digits — not just 5. The following JavaScript function programmatically sets the value:
🌐
LOC
loc.gov › standards › sourcelist › date-time.html
Date and Time Scheme Source Codes: Source Codes for Vocabularies, Rules, and Schemes (Network Development and MARC Standards Office, Library of Congress)
Date and Time Scheme Source Codes: Source Codes for Vocabularies, Rules, and Schemes (Network Development and MARC Standards Office, Library of Congress)
🌐
Microsoft Learn
learn.microsoft.com › en-us › system-center › orchestrator › standard-activities › format-date-time
Format Date-Time | Microsoft Learn
The Format Date/Time activity enables you to transform the existing date and time formats into custom formats that you create.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-simpledateformat-java-date-format
Master Java Date Formatting: SimpleDateFormat & DateFormat Guide | DigitalOcean
December 20, 2024 - SimpleDateFormat is the concrete class that extends DateFormat class. SimpleDateFormat can be created using the SimpleDateFormat constructor. The constructor is a parametrised constructor and needs a String pattern as the parameter. String pattern = "MM-dd-yyyy"; SimpleDateFormat simpleDateFormat ...
🌐
Analytics Vidhya
analyticsvidhya.com › home › making programming with date and time, less painless
Programming Date and Time | Make Programming with Date & Time Easy
October 28, 2024 - According to the format the convention is from the most significant digit to the least significant digits. Thus, the format is: ... Most of the computers count time from an arbitrary instant called the Unix epoch. This arbitrary date is January 1st, 1970, at 00:00:00 hours UTC.
🌐
Google
developers.google.com › style › dates and times
Dates and times | Google developer documentation style guide | Google for Developers
If you must express a date in numerical date format, use the format YYYY-MM-DD, and separate the elements by using hyphens.
🌐
Rosetta Code
rosettacode.org › wiki › Date_format
Date format - Rosetta Code
3 weeks ago - Sun // [sunday] - full weekday name, e.g. Sunday // [jan] - abbrev month // [january] - full month // [day] - day of the month 1, 2, ..31 // [day2] - day of the month as two digits 01, 02, ..31 // [hour] - hour 00, 01, 03..23 // [hour12] - hour ...
🌐
W3C
w3.org › International › questions › qa-date-format
Date formats
ISO 8601 specifies a format of YYYY-MM-DD. 2003-04-02 is clearer than 03/04/02. (Some prefer to modify ISO 8601 by using an abbreviation for the month to make it more clear, for example 2003-Apr-02, but then it is no longer locale neutral.). ... This method is unambiguous.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN
JavaScript Date objects represent a single moment in time in a platform-independent format. Date objects encapsulate an integral number that represents milliseconds since the midnight at the beginning of January 1, 1970, UTC (the epoch).
🌐
Golden Software
surferhelp.goldensoftware.com › gscomlib › Date_Time_Formats.htm
Date Time Formats
Date/Time formats are made of combinations of locale, year, month, day, hours, minutes, seconds, BC/AD or BCE/CE designation, and AM/PM designation. Years are shown as yy or yyyy. Months are shown as M, MM, MMM, MMMM, or MMMMM. Days are shown as d, dd, ddd, or dddd.
🌐
Qlik Talend Help
help.qlik.com › talend data preparation user guide › working with the data › cleansing dates › list of date and date/time formats
List of date and date/time formats | Talend Data Preparation User Guide Help
Date and time are formatted according to the different conventions all around the world. Locale-specific date and date/time formats are specified by date and time pattern strings.