
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Long Date ("D") Format Specifier in C#
The "D" format specifier represents a custom date and time format string.
The format string is defined by culture's DateTimeFormatInfo.LongDatePattern property.
The custom format string is −
dddd, dd MMMM yyyy
Example
using System; using System.Globalization; class Demo { static void Main() { DateTime myDate = new DateTime(2018, 9, 20); Console.WriteLine(myDate.ToString("D", CultureInfo.CreateSpecificCulture("en-US"))); } }
Output
Thursday, September 20, 2018
- Related Articles
- Short Date ("d") Format Specifier
- General Date Long Time ("G") Format Specifier in C#
- Full Date Long Time ("F") Format Specifier in C#
- Long Time ("T") Format Specifier in C#
- C# Decimal ("D") Format Specifier
- Full Date Short Time ("f") Format Specifier in C#
- C# General Date Short Time ("g") Format Specifier
- Set format specifier in MySQL STR_TO_DATE() and convert string to date
- Difference between %d and %i format specifier in C
- Difference between %d and %i format specifier in C language.
- How to get string as date in MySQL with dates as dot format specifier?
- Sortable ("s") Format Specifier in C#
- Precision String Format Specifier In Swift
- Long style format for Date with Java MessageFormat class
- C# Hexadecimal ("X") Format Specifier

Advertisements