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 484681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:19:29+00:00 2026-05-13T01:19:29+00:00

The MySQL database has a date field in this format: yyyy-mm-dd (2009-12-01) When this

  • 0

The MySQL database has a date field in this format:

yyyy-mm-dd (2009-12-01)

When this field is pulled into a Gridview the format changes to:

yyyy-mm-dd HH:mm (2009-12-01 12:00)

How do I get the gridview not to change the default database format?

(most solutions that I have found recommend setting the value in asp:boundfield but this requires the potentially risky HtmlEncode=false)

  • 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-05-13T01:19:29+00:00Added an answer on May 13, 2026 at 1:19 am

    I don’t think that it would be risky to set HtmlEncode = false on date/time field. It’s unlikely that any sql injection attack could inject potentially harmful script into a datetime value.

    It sounds like the solutions you’ve found probably refer to setting the DataFormatString and setting HtmlEncode = false. I would go with one of the solutions you’ve already found.

    Or as found here: http://peterkellner.net/2006/05/24/how-to-set-a-date-format-in-gridview-using-aspnet-20using-htmlencode-property/

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

Sidebar

Related Questions

i have a mySql database, and it has an field for each entry called
Essentially I have a mysql database with users and their corresponding date of birth.
Hello I am trying to display work orders from my mysql database to show
I have a field in MySQL of type text, using the following collation: utf8_general_ci
I am storing some records in a database. A record has a 'last visited'
I don't know PHP very well, so please bear with me. My client has
I have a table called BUILD_INFO and it has the following columns: BUILD_ID BUILD_NAME
We've been working on implementing timezone support for our Web app. This great SO
Our client has a Magento-powered store and needs the ability to create tax reports
I'm displaying a set of rows here for every car I have in my

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.