- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Full Date Short Time ("f") Format Specifier in C#
The Full Date Short Time standard format specifier represents a combination of the long date ("D") and short time ("t") patterns.
UseDateTime to set the date.
DateTime myDate = new DateTime(2018, 8, 29, 1, 10, 0);
Now, use the (“f”) format specifier like this −
myDate.ToString("f", CultureInfo.CreateSpecificCulture("en-US"))
The following is an example −
Example
using System; using System.Globalization; class Demo { static void Main() { DateTime myDate = new DateTime(2018, 8, 29, 1, 10, 0); Console.WriteLine(myDate.ToString("f",CultureInfo.CreateSpecificCulture("en-US"))); } }
Output
Wednesday, August 29, 2018 1:10 AM
Advertisements