MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › DateTimeFormat
Intl.DateTimeFormat - JavaScript | MDN
The Intl.DateTimeFormat object enables language-sensitive date and time formatting.
Adobe
helpx.adobe.com › coldfusion › cfml-reference › coldfusion-functions › functions-c-d › DateTimeFormat.html
DateTimeFormat
May 30, 2024 - dateTimeFormat (date) dateTimeFormat (date [, mask]) dateTimeFormat (date [, mask, timeZone]) <cfscript> Date1 = "{ts '2018-11-05 12:13:50'}"; DateTimeFormat= DateTimeFormat(Date1,"m") DateTimeFormat1= DateTimeFormat(Date1,"mm") DateTimeFormat2= DateTimeFormat(Date1,"mmm") DateTimeFormat3= DateTimeFormat(Date1,"mmmm") DateTimeFormat4= DateTimeFormat(Date1,"M") writeOutput("Month as digits; no leading zero for single-digit months: " & DateTimeFormat & "<br/>") writeOutput("Month as digits; leading zero for single-digit months: " & DateTimeFormat1 & "<br/>") writeOutput(" Month as a three-letter
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › format › DateTimeFormatter.html
DateTimeFormatter (Java Platform SE 8 )
October 20, 2025 - The main date-time classes provide two methods - one for formatting, format(DateTimeFormatter formatter), and one for parsing, parse(CharSequence text, DateTimeFormatter formatter).
Spring
docs.spring.io › spring-framework › docs › current › javadoc-api › org › springframework › format › annotation › DateTimeFormat.html
DateTimeFormat (Spring Framework 7.0.6 API)
Note: This pattern follows the original SimpleDateFormat style, with strict parsing semantics towards overflows (for example, rejecting a Feb 29 value for a non-leap-year). As a consequence, 'yy' characters indicate a year in the traditional style, not a "year-of-era" as in the DateTimeFormatter specification (i.e.
Joda
joda.org › joda-time › apidocs › org › joda › time › format › DateTimeFormat.html
DateTimeFormat (Joda-Time 2.14.1 API)
Datetime formatting is performed by the DateTimeFormatter class. Three classes provide factory methods to create formatters, and this is one.
Gwtproject
gwtproject.org › javadoc › latest › com › google › gwt › i18n › client › DateTimeFormat.html
DateTimeFormat (GWT Javadoc)
It does this by adjusting dates to be within 80 years before and 20 years after the time the parser instance is created. For example, using a pattern of "MM/dd/yy" and a DateTimeFormat object created on Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while the string ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › DateTimeFormat › DateTimeFormat
Intl.DateTimeFormat() constructor - JavaScript | MDN
January 21, 2026 - The Intl.DateTimeFormat() constructor creates Intl.DateTimeFormat objects.
Lucee Documentation
docs.lucee.org › reference › objects › datetime › datetime.datetimeformat()
DateTimeFormat() :: Lucee Documentation
//format the date parts as like as dateformat() //formant the date & time by user defined date dateandtime = createDateTime(2015,02,04,11,22,33); writeDump(dateTimeFormat(dateandtime, "GG-dddd, dd/mmm/yyyy,hh:nn:ss tt,zzzz")); //formant the date & time by server time dateandtime = createDateTime(year(now()),month(now()),day(now()),hour(now()),minute(now()),second(now())); writeDump(dateTimeFormat(dateandtime, "dddd, dd/mmm/yyyy,hh:nn:ss tt,zzzz")); writedump(dateTimeFormat(now(), "mm/dd/yyyy")); writedump(dateTimeFormat(now(), "MM/DD/YYYY")); writeDump(dateTimeFormat(now(), "EEEE-dd,mm,yyyy"))
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › base-types › custom-date-and-time-format-strings
Custom date and time format strings - .NET | Microsoft Learn
The "t" custom format specifier represents the first character of the AM/PM designator. The appropriate localized designator is retrieved from the DateTimeFormatInfo.AMDesignator or DateTimeFormatInfo.PMDesignator property of the current or specific culture. The AM designator is used for all times from 0:00:00 (midnight) to 11:59:59.999.
Rafaelcamargo
rafaelcamargo.com › blog › mastering-date-formatting-using-intl-date-time-format-in-javascript
Mastering date formatting using Intl.DateTimeFormat in JavaScript
May 29, 2024 - const date = new Date(2024, 3, 29, 0); const opts = { day: 'numeric', year: 'numeric' }; Intl.DateTimeFormat('en-US', { ...opts, month: 'long' }).format(date); // → April 29, 2024 Intl.DateTimeFormat('en-US', { ...opts, month: 'short' }).format(date); // → Apr 29, 2024 Intl.DateTimeFormat('en-US', { ...opts, month: 'narrow' }).format(date); // → A 29, 2024
Top answer 1 of 2
4
Here's my version of this, you can use formatToParts() function to get them by part assuming you will be using the same format every time, and then get them by object array so that you can create your own format allowing you to add custom text. Although it would be much more easier and efficient if you will use some other Date formatter.
let checkoutDate = new Date();
var th = 'th';
var formatter = new Intl.DateTimeFormat('en-us', {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
fractionalSecondDigits: 3,
timeZone: 'UTC'
});
var formatted = formatter.formatToParts(checkoutDate);
var day = formatted[4].value;
var wr = checker(day);
console.log(wr);
console.log(formatted[0].value+ ',', day +wr, formatted[2].value, formatted[6].value);
function checker(x){
if (x > 3 && x < 21) return 'th';
switch (x % 10) {
case 1: return "st";
case 2: return "nd";
case 3: return "rd";
default: return "th";
}
}
//output Friday, 13th March 2020
2 of 2
0
You can try this way:
var isoString = new Date().toISOString();
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var date = new Date(isoString);
var americanDate = new Intl.DateTimeFormat("en-US", options).format(date);
console.log(americanDate); //Friday, March 13, 2020
Using moment.js you can do better date-time format.
GitHub
github.com › tc39 › ecma402 › issues › 891
Preferred DateTimeFormat invocation to get YYYY-MM-DD formatting · Issue #891 · tc39/ecma402
May 15, 2024 - const formatter = new Intl.DateTimeFormat('en-US',{ year: 'numeric', month: '2-digit', day: '2-digit', }); const parts = formatter.formatToParts(date); obj = Object.fromEntries(Array.from(parts.values()).map(v => ([v.type, v.value]))); `${obj.year}-${obj.month}-${obj.day}` // '2024-05-15' It gets the job done (and probably won't break even if CLDR changes some fundamental en-US things), but it's not not so elegant.
Published May 15, 2024
Author paulirish
Wikipedia
en.wikipedia.org › wiki › ISO_8601
ISO 8601 - Wikipedia
1 week ago - ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. It is maintained by the International Organization for Standardization (ISO) and was first published in 1988, with updates in 1991, 2000, 2004, and 2019, and an amendment in 2022.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-intl-datetimeformat-format-method
JavaScript Intl DateTimeFormat format() Method - GeeksforGeeks
July 12, 2025 - const Geeks = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; const dateformat = new Date(1997, 06, 30); const dateTimeFormat4 = new Intl.DateTimeFormat('hi', Geeks); console.log(dateTimeFormat4.format(dateformat)); const dateTimeFormat2 = new Intl.DateTimeFormat('en-GB', Geeks); console.log(dateTimeFormat2.format(dateformat)); const dateTimeFormat1 = new Intl.DateTimeFormat('sr-RS', Geeks); console.log(dateTimeFormat1.format(dateformat)); const dateTimeFormat3 = new Intl.DateTimeFormat('en-US', Geeks); console.log(dateTimeFormat3.format(dateformat));