C#.NET: How to utilize Pre-Defined Date/Time Formats
Asmak9.EssentialToolKit library provides a rich list of pre-defined date/time formats in order to convert date/time into target date/time format.
Today, I shall be demonstrating utilization of pre-defined date/time formats of Asmak9.EssentialToolKit .NET library in order to convert date/time into target date/time format using C#.NET console application.
Today, I shall be demonstrating utilization of pre-defined date/time formats of Asmak9.EssentialToolKit .NET library in order to convert date/time into target date/time format using C#.NET console application.
Prerequisites:
Following are some prerequisites before you proceed any further in this tutorial:- Install Asmak9.EssentialToolKit Nuget Package.
- Knowledge of Nuget Package Manager.
- Knowledge of C# Programming.
Download Now!
Let's begin now.1) Create new C#.NET console application and name it "DateTimeFormats".
2) Open "Tools\Nuget Package Manage\Manage Nuget Packages for Solution...".
3) Install Asmak9.EssentialToolKit Nuget Package.
4) Now, create "DateTimeFormats.cs" file and type following lines of code i.e.
... // Convert Date/Time to String with Formats method. // Default Date. string date = utilityKit.ConvertDateTimeToString(dateTimeVal, datetimeFormats.DATE_FORMAT_DEFAULT); // Default Time. string time = utilityKit.ConvertDateTimeToString(dateTimeVal, datetimeFormats.TIME_FORMAT_DEFAULT) + "\n"); // Default Date/Time string datetime = utilityKit.ConvertDateTimeToString(dateTimeVal, datetimeFormats.DATETIME_FORMAT_DEFAULT); ...
The above code will convert date/time into target date/time format by utilizing the pre-defined Date/Time formats provided by Asmak9.EssentialToolKit nuget library. You also need to initialize 'UtilityKit' and 'DateTimeFormats' classes with or without your license key.
5) Execute the project and you will be able to see the following i.e.
Post a Comment