When I use DateTimeFormatInfo, Sometimes current thread culture is used for generating the result string and some times the culture I get DateTimeFormatInfo from it. Also there is situation where Invariant Culture is used. What is the logic behind it?
When using DateTimeFormatInfo, Which Culture is used in generating the result string?
62 Views Asked by Mehdi Mowlavi At
1
There are 1 best solutions below
Related Questions in .NET
- Does compiler optimize operation on const variable and literal const number?
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- .net rest service with JSON string and consumed with java client
- What is best way to check if any of the property of object is null or empty?
- Telerik's WPF RadColorPicker NoColorText property not working
- Possible consequences of duplicate ProgId for different classes
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Optimizing C++ call from C#
- Make a per-web-application object available to Web API and SignalR controllers
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- LINQ Except/Distinct based on few columns only, to not add duplicates
- Not displaying content by its URL string - absolute urls
Related Questions in CALENDAR
- Having trouble writing a calendar, I couldn't find a detailed guide answering my questions anywhere
- Algorithm to find the Gregorian date of the Chinese New Year of a certain Gregorian year
- google calender library disable Previous date
- Adding calendar in ms access and view the data of specific day by clicking the date
- Can't call EWS service with API Java SSL and certificates
- Obtaining value from Calendar control without selecting a day
- Generating dates to the days of a week in Python?
- "is this date the third thursday of the month?" - Java Library?
- Django: Which days have objects?
- Adding reminder to event fails in Android
- Embed editable google calendar for those who have the access
- How to open different activities for each day in the custom calendar
- having trouble in setting up a calendar in tkinter
- How to fetch tasks from android calendar?
- How do i delete the JLabel from previous creation?
Related Questions in CULTUREINFO
- ToLower vs ToLowerInvariant
- System.Globalization.RegionInfo complete list of valid culture inputs
- Validate double number in current culture
- Get language and country code (ISO 639-1)
- Parse/Read a double at a known start position in a string
- DateTime get the letters representing day, month, year from the currentculture
- .net How do I know 12/24 hour format when I know the culture Info
- Parsing a string with a number on basis of culture
- Setting the Culture of only a single view, not the entire program
- Why does Convert.ToInt32 accept IFormatProvider?
- .Net CurrentCulture ShortDateFormat doesn't update according to PC regional settings
- Format not getting applied in French culture
- What is the use of CultureInfo.InvariantCulture.Calendar.GetDayOfWeek?
- Is this safe, or will it only work in English-speaking countries?
- When to pass Culture when comparing strings using Assert.AreEqual() in C#
Related Questions in IFORMATPROVIDER
- How to use IFormatProvider in DateTime.ParseExact
- Parsing non standard date strings in C#
- IFormatProvider with Integer value
- StreamWriter and IFormatProvider
- What is the string representation of the IEEE 1xxx floating point format, and how do I output it?
- Visual Studio 2010 Code Analysis CA1305 (Specify IFormatProvider) rule doesn't work for TryParse methods
- Can I use IFormatProvider with a WPF Binding to a custom type?
- DefaultCellStyle.FormatProvider in DataGridView
- Custom string formatter in C#
- Is there a way to get a compile time constant CulutureInfo?
- Using a custom formatter in a DataGridView
- How do I use IFormatProvider with ASP.Net?
- How to create and use a custom IFormatProvider for DateTime?
- What's the purpose of the format provider in ParseExact() of DateTime and DateTimeOffset?
- ICustomFormatter that works with uint.ToString
Related Questions in DATETIMEFORMATINFO
- Date/Time datatype ms access 2010 month names in proper yearly order
- Parsing non standard date strings in C#
- ISO 8601 Define repeating interval on Thanksgiving?
- get pandas dataframe column datetime format
- Why does DateTimeInfo.MonthNames return a 13 member?
- How to get the integer value of all days of week using DateTimeFormat.DayNames? c#
- Editing Date and Time in python through SQLite3
- Arabic date displaying incorrectly
- Get current date time in the desired format
- DateTimeFormatInfo string format for day of week. Thursday becomes Th
- When using DateTimeFormatInfo, Which Culture is used in generating the result string?
- java parse date with picosecond
- How to show only current month and previews month's dates selectable in datePickerDialog?
- Convert ASP.NET textbox control .text contents to Date/Time format
- Intl.DateTimeFormat does not output same results on different machines
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
When we build a
DateTimeFormatInfo, it always specify the format string. If we pass it asIFormatProviderto theToStringorstring.Formatmethods, its calendar used for displaying datetime too (date elements calculated by that calendar) but if we do not pass it, current culture info passed asIFormatProviderby default and so current culture calendar used for calculation of date time elements. In Four special case, despite every culture you used for creatingDateTimeFormatInfoor everyIFormatProvideryou pass to those methods, Invariant Culture and Invariant Calendar used. These are:"O" (or "o"), "R" (or "r"), "s", and "u". The following example show some example: