473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to make the short date format without time showing

hi , all
In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM"
How to remove "12:00:00 AM" and only make it shows "3/27/2006" ?
Thanks very much
Henry
Mar 28 '06 #1
3 14303
<the date>.tostring("d") or you could do a <the date>.tostring("mm/dd/yyyy")

"Henry Lee" wrote:
hi , all
In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM"
How to remove "12:00:00 AM" and only make it shows "3/27/2006" ?
Thanks very much
Henry

Mar 28 '06 #2
Hello Henry,

You can get the short date formate from the datetime object by calling the
DateTime.ToShortDateString() method. It is also the equivalent of calling the
DateTime.ToString("d", null) method. Check out the help file for more
information on Formatting Overview.
--
brians
http://www.limbertech.com
"Henry Lee" wrote:
hi , all
In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM"
How to remove "12:00:00 AM" and only make it shows "3/27/2006" ?
Thanks very much
Henry

Mar 28 '06 #3
Well, there is a method called ToShortDateString()

alternatively, you can fully format a date to a string by using ToString()
and specifying the format.

http://msdn.microsoft.com/library/de...matstrings.asp

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Henry Lee" <lh****@dynamiceng.com> wrote in message
news:O2****************@TK2MSFTNGP14.phx.gbl...
hi , all
In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM"
How to remove "12:00:00 AM" and only make it shows "3/27/2006" ?
Thanks very much
Henry

Mar 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
4
by: Jo | last post by:
Is there anyway we can know using JavaScript the Short Date Format used in the Control Panel -> Regional and Language Settings? I know the using the combinations of following we can get the...
6
by: ABC | last post by:
I set the date format as "MM/dd/yyyy" on control panel. Then, I use System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern to return short date format. But it has not return my...
3
by: MattB | last post by:
I've hit a snag with an application I wrote because of the differing date formats in different countries. It's a set of pages that make calls to a COM object that I have wrapped in a web...
5
by: Ellis Yu | last post by:
Dear All I want to read the short date format pattern from the regional setting. I write a code as follow: 'Diff. machine may has different country setting, so I use blank here Dim a as new...
1
by: ABC | last post by:
Is there any function return the short date format on the regional and Language Options under control panel?
2
by: savigliano | last post by:
hello, i am doing a date comparation and i have reallize that the data i have in my database (general date format) it is causing me problems, and because i don´t need the time data i would like to...
6
by: theinvisibleGhost | last post by:
Is there a method of determining which format the short date format is stored in for the current user on the machine using .NET? If it is not in UK format I ideally need to be able to set it to...
2
by: saidfathi | last post by:
first... I'm Said Fathi I need to make a stored to search between 2 date and search by date only without time in sql server.... how can make this... in SQL server Stored
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.