• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

Date \ Time issue

I'm new to ASP web development and SQL, I've been developing a small web application and so far all is good, I do have one annoying issue around the date, in my gridviews and also in the SQL database dates are displayed as the following:

datetime datatype
Any advice on how to elimnate this issue ? I'm using SQL 2008 Express and the datetime data type.
0
ndr-itsolutions
Asked:
ndr-itsolutions
1 Solution
 
Paul MacDonaldDirector, Information SystemsCommented:
You don't have any control over how datetimes are stored in SQL Server, but you have complete control over how they're displayed in your ASP.Net application.  What, specifically, were you looking to do?
0
 
Meir RivkinFull stack Software EngineerCommented:
you can pick your date time format here:
Date Time Formats

if you want to get rid of the time and leave the date use:
date.ToString("dd/MM/yy")

Open in new window

0
 
NalinkumarbalajiCommented:
Format the Date within the SQL Itself.

In the Query use "Convert(Varchar, YourDateField,101) as YourDateField".
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now