By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Date Format

P: n/a

I always get 12:00:00 time next to the date in my VB.NET Windows form
application. How can I get only the date to appear?

Panos Adam
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
With Deft Fingers, "Barbara Papapetrou" <ab******@otenet.gr> wrote:
I always get 12:00:00 time next to the date in my VB.NET Windows form
application. How can I get only the date to appear?


Several ways...

lblCurrDay.Text = dtpDatePick.Value.ToString("dd/MM/yyyy")

.... (the dtpDatePick is a DateTimePicker)

or

newDate = FormatDateTime(lblCurrDay.Text, DateFormat.ShortDate)

The DateFormat gives you a few options... the first one some other custom
options... Check up on them.

Regards,

Bruce
Nov 20 '05 #2

P: n/a
"Barbara Papapetrou" <ab******@otenet.gr> schrieb

I always get 12:00:00 time next to the date in my VB.NET Windows
form application. How can I get only the date to appear?


Use a different format string, like "MM\.dd\.yyyy"

dim d as date

msgbox d.tostring("MM\.dd\.yyyy")
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
* "Barbara Papapetrou" <ab******@otenet.gr> scripsit:
I always get 12:00:00 time next to the date in my VB.NET Windows form
application. How can I get only the date to appear?


There are many different ways depending on the format you want to be
displayed. For example 'MsgBox(d.ToShortDateString())' or the date's
'ToString' method with the appropriate format string...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
You could also use the Format() function from the Strings class in the
Microsoft.VisualBasic namespace. You can format your date anyway you want.

LB.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* "Barbara Papapetrou" <ab******@otenet.gr> scripsit:
I always get 12:00:00 time next to the date in my VB.NET Windows form
application. How can I get only the date to appear?


There are many different ways depending on the format you want to be
displayed. For example 'MsgBox(d.ToShortDateString())' or the date's
'ToString' method with the appropriate format string...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.