DateTime Format

A date and time format string defines the text representation of a DateTime value that results from a formatting operation.

Questions

Related Tags:
C# C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. Learn More, ASP.NET MVC The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. Learn More, DateTime Format A date and time format string defines the text representation of a DateTime value that results from a formatting operation. Learn More,

Question:Display Gregorian calendar date with Arabic digits instead of Hijri Calendar date in c#?

Description:we have a multilingual website in which we have event start date and end date which is correctly displayed for English language version of the page but when we go to its Arabic version of the page, it basically convert the date to Hijri calendar date. Currently we are using following code in which we are just getting the dates from database and format it as shown string startDate= sourceEvent?.Fields.EventStart.ToString("dd.MM.yy"); string endDate= sourceEvent?.Fields.EventEnd.ToString("dd.MM.yy"); Output for English page 25.05.22 - 28.05.22 Output of Arabic page: 24.10.43 - 27.10.43 instead the Arabic page output we required: ۲۵.۰۵.۲۲ - ۲۸.۰۵.۲۲

View Details

Posted by: Umer khan | Posted on: May 30, 2022


1