tagged [datetime-format]
Converting Double to DateTime?
Converting Double to DateTime? I have a .CSV file which I am reading into a C# program. In one of the columns, there is a date, but it is in the "general" format, so it shows up in the .CSV as a numbe...
- Modified
- 15 Nov at 13:24
Remove hours:seconds:milliseconds in DateTime object
Remove hours:seconds:milliseconds in DateTime object I'm trying to create a string from the DateTime object which yields the format `mm:dd:yyyy`. Conventionally the `DateTime` object comes as `mm:dd:y...
- Modified
- 18 Mar at 13:10
How do I get the AM/PM value from a DateTime?
How do I get the AM/PM value from a DateTime? The code in question is below: ``` public static string ChangePersianDate(DateTime dateTime) { System.Globalization.GregorianCalendar PC = new System.G...
- Modified
- 29 Aug at 02:45
C# DateTime ToString("MM-dd-yyyy") returns funny day values
C# DateTime ToString("MM-dd-yyyy") returns funny day values I have the following code in the codebehind file of an ASP.Net page Which I expect to return "09-11-2009". However, when I run the page on t...
- Modified
- 11 Sep at 14:46
Issue DateTime.ToString with string format "M" in .NET
Issue DateTime.ToString with string format "M" in .NET I have a problem with the string format of DateTime. I think it is bug in MS. Can you explain it, and what is wrong? ``` class Program { static...
- Modified
- 21 Jan at 15:49
How to add literal strings in a DateTime format?
How to add literal strings in a DateTime format? Is it possible to add the word "at" between a Date and Time format? I tried to add it just like this "dddd, d MMM, yyyy HH:mm" but the webapp is tranfo...
UnsupportedTemporalTypeException when formatting Instant to String
UnsupportedTemporalTypeException when formatting Instant to String I'm trying to format an Instant to a String using the new Java 8 Date and Time API and the following pattern: Using the code above I ...
- Modified
- 6 Feb at 21:17
Convert one date format into another in PHP
Convert one date format into another in PHP Is there a simple way to convert one date format into another date format in PHP? I have this: But I'd of course like it to return a current date
- Modified
- 5 Jun at 19:7
Convert DateTime to a specified Format
Convert DateTime to a specified Format I have this date format `yy/MM/dd HH:mm:ss` ex: `12/02/21 10:56:09`. The problem is, when i try to convert it to different format using this code: It displays `D...
- Modified
- 21 Feb at 06:10
Display DateTime value in dd/mm/yyyy format in Asp.NET MVC
Display DateTime value in dd/mm/yyyy format in Asp.NET MVC Is it possible to display a `DateTime` value in format with the help of `HTML Helper` methods in `Asp.NET MVC`? I tried to do this by using s...
- Modified
- 27 May at 10:56
Is there a way to find the first string that matches a DateTime format string?
Is there a way to find the first string that matches a DateTime format string? Given a date time format string, is there a standard way to find the first matching substring that matches that format? f...
- Modified
- 8 Jul at 03:11
Set Default DateTime Format c#
Set Default DateTime Format c# Is there a way of setting or overriding the default DateTime format for an entire application. I am writing an app in C# .Net MVC 1.0 and use alot of generics and reflec...
- Modified
- 5 Oct at 12:32
Convert C# DateTime to Javascript Date
Convert C# DateTime to Javascript Date I have a function in Javascript that receives a C# DateTime from MVC. If the date is null it should return "-", if it's a valid date it should return the formate...
- Modified
- 30 Jul at 15:5
DateTime.ToString() format that can be used in a filename or extension?
DateTime.ToString() format that can be used in a filename or extension? I want to add a timestamp to filenames as files are created but most of the DateTime methods I've tried output something with sp...
- Modified
- 19 Sep at 17:42
Unable to set datetime format in MVC 4 using data annotations
Unable to set datetime format in MVC 4 using data annotations I will try everything but not working this() date format, this always gate Razor view ``` @Html.EditorFor(model => model.rel
- Modified
- 11 Nov at 08:2
Converting a string to datetime from "yyyy-MM-dd"
Converting a string to datetime from "yyyy-MM-dd" Even though it seems like this question has been asked a bunch of times, I can't seem to find an answer that is specific to my question: I have a vari...
- Modified
- 9 Mar at 13:13
"asp-format" not applied to tag helpers
"asp-format" not applied to tag helpers I'm facing a problem using "asp-format" tag with taghelper element in my mvc 6 project. The idea is to format a date input element this way: This "StartDate" pr...
- Modified
- 21 Jun at 16:51
How can I convert date time format string used by C# to the format used by moment.js?
How can I convert date time format string used by C# to the format used by moment.js? uses string like that `'dd MMMM yyyy HH:mm'` to define format the date and time should be displayed in. Equivalent...
- Modified
- 14 Jan at 18:46
Python datetime to string without microsecond component
Python datetime to string without microsecond component I'm adding UTC time strings to Bitbucket API responses that currently only contain Amsterdam (!) time strings. For consistency with the UTC time...
- Modified
- 3 Nov at 18:49
Are there built-in Month name declensions in C#
Are there built-in Month name declensions in C# I'm wondering if there's any built-in functionality in .NET for declining dates in languages that support noun declensions, (ie. In Russian the month na...
- Modified
- 9 Feb at 09:57
C# string to DateTime with timezone
C# string to DateTime with timezone I want to format the string : "2012-04-20 10:10:00+0200" to a dateTime with this format. so I think it must be "yyyy-MM-dd hh:mm:ss zzz"? when I tried this ``` // s...
how to change en-US dates to en-GB for asp.net?
how to change en-US dates to en-GB for asp.net? on a developer machine (cassini) results in which is correct but when deployed to a full IIS server the result is The server is set in control panel/Reg...
- Modified
- 15 Mar at 08:59
How to format a date in C# by example?
How to format a date in C# by example? C# provides a lot of flexibility when formatting a DateTime object for a string representation, however, one has to know all format strings to use that flexibili...