Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:30:19+00:00 2026-06-04T18:30:19+00:00

I have a model Toto with a DateTime Time. I have a basic controller

  • 0

I have a model Toto with a DateTime Time.
I have a basic controller who can edit Toto.
In the edit view, I can see the date in format : MM/dd/yyyy hh:mm:ss AM(PM)
I store that Time in a database.
But how can I display it in this format: dd/MM/yyyy.

I already found a way, I just add

[DisplayFormat(ApplyFormatInEditMode=false, DataFormatString =
“{0:dd/MM/yyyy}”)]

It works well when i look at all my entries but in the edit mode I have the same basic format (MM/dd…).
So I change :

ApplyFormatInEditMode=true

The format in the edit view is good but when I save it, it tells me that : The value ’30/10/2012′ is not valid for Time.

How can I apply the format in the Edit view ?

Many thanks.


To be clear, I want the format : dd/MM/yyyy and not MM/dd/yyyy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:30:21+00:00Added an answer on June 4, 2026 at 6:30 pm

    change the DataFormatString to {0:d} as like

    [DisplayFormat(ApplyFormatInEditMode=true, DataFormatString = "{0:d}")]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model which can be attached to to other models. class Attachable(models.Model):
I have a view model that show a product.. but the price is in
I have the following view <ul data-role=listview data-inset=true> <!-- ko with: model.Item_selected --> <li
I have a list in my model, EmployeeList In my View I want to
I have model show which has_many performances and a performance has a certain location.
I have model User class User < ActiveRecord::Base has_and_belongs_to_many :roles attr_accessible :login, :email, :password,
I have model Foo which has field bar. The bar field should be unique,
I have model Article it has field title with some text that may contain
I have model public class UploadOptionModel { public UploadOptionModel() { OutputFormat = outputFormatList.Select(i =>
I have model: [XmlRoot(ElementName = event, IsNullable=true)] public class Event { public int id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.