Linked Questions
16 questions linked to/from Format datetime in asp.net mvc 4
1 vote
2 answers
9k views
DisplayFormat in MVC datetime [duplicate]
I am trying to format date time attribute in MVC 4 class like this : [Required] [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true,DataFormatString = "{0:dd/MM/yyyy}")] public ...
0 votes
1 answer
1k views
Parsing date time strings with C# MVC [duplicate]
I understand that if you want to parse a dateTime String in a specific format when converting it to a DateTime object you do this DateTime someDateTime = DateTime.ParseExact(myDateTime , "dd MMM yyyy ...
28 votes
3 answers
34k views
ASP.NET MVC3 - DateTime format
I'm using ASP.NET MVC 3. My ViewModel looks like this: public class Foo { [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true)] ...
13 votes
4 answers
24k views
MVC 4 how to validate a non-US date with client validation?
I have a situation where I am having trouble with the client side validation of a datetime field. When I try to submit it keeps telling me the date is invalid (27/7/2013). But if I turn the date ...
10 votes
2 answers
33k views
Specify Date format in MVC5 (dd/MM/yyyy)
I'm trying to handle user input for date values, I want to prompt user to input date in this format: dd/MM/yyyy what I tried to do: I read and implement the answer for Darin in this question: Format ...
4 votes
3 answers
19k views
date format dd/MM/yyyy not working in asp.net mvc 5
I'm developing an asp.net mvc 5 application, in which I'm trying to set a validation for dd/MM/yyyy format, I've been struggling a lot to find an appropriate solution but no success, what I want it to ...
2 votes
4 answers
24k views
C# MVC 4 ViewModel not accepting null DateTime
I'm in a bit of trouble here learning C# and mvc4. The Problem occurs in the Filter part of my application. I have an ViewModel that grabs the list of "Listar_Produtos" of the database, and some ...
1 vote
3 answers
15k views
Working with Datetime & date picker
I want to test the data picket on my asp.net mvc web application. 1.So I created the following test model:- public class TestClass { [DataType(DataType.Date)] public DateTime D { ...
7 votes
2 answers
6k views
How DateTime is validated in MVC Unobtrusive Validation?
Using MVC4 with client-side & unobtrusive validation enabled, I'm trying to understand how the validation determine if an entered DateTime value is valid or not. In my application this formatted ...
2 votes
2 answers
21k views
Formatting DateTime in model to Date only in View
I am using ASP.NET MVC 5. I have a date only picker in my create and edit form. In create form, its working just fine. But in edit form, it loads previously saved DateTime as dd-MM-yyyy hh:mm:ss. On ...
2 votes
1 answer
2k views
passing parameter datetime? in mvc with jquery
Iam try pass a few parameters to controller with javasqcrip and jquery. this is the code: @using PagedList.Mvc; @model PagedList.IPagedList<Universidad.Entidades.PER_PERSONAS> @{ Layout =...
1 vote
4 answers
2k views
.NET saving date in dd/MM/yyyy format in HttpPost
Unlike the U.S.A ... most other countries uses the dd/MM/yyyy format (from smallest to biggest). However, .NET naturally takes in date in MM/dd/yyyy format. I have an input that accepts a datetime, ...
0 votes
2 answers
2k views
Asp.net mvc 4 getting decimal value instead integer
I have a class like: public class Item { public int ItemID { get; set; } [Display(Name = "Value")] [Column(TypeName = "money")] public decimal Value{ get; set; } } In the form I ...
-1 votes
1 answer
830 views
Datetime editortemplate not applied in partial view
I searched almost every topic on this site regarding date format also DatePicker however couldn't find any solution for my issue, also applied This with no success Problems Date format is not applied ...
0 votes
0 answers
591 views
how to set a date from a datepicker to be able to save mvc 5
I have a edit page for the deviceassignments and when i click on save when i change le "status du prêt" for example, i have this error with my DateLoan and my DateReturned. When i create a ...