473,385 Members | 1,843 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,385 software developers and data experts.

Date Format


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
4 2518
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
"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
* "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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alistair | last post by:
it's the idiot with his query strings again...."yippeee" I hear aaron shout this time the problem is with a date format query I have a query string thus strSQL = "SELECT * FROM users where...
2
by: Ian | last post by:
I have a problem I hope someone can point out where I am going wrong. I need to store a date/time in a cookie ( ie the date a visitor last visited ) However the date format changes to US, despite...
1
by: jt | last post by:
I posted this yesterday, but I am not seeing this out yet: I am having problems with updating a date field in a certain format. The data is stored in an Oracle database. The date is...
15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
2
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
3
by: Tony WONG | last post by:
The date format (control panel) of testing (VS2005) and production platform are yyyy/mm/dd. i run preview from testing (VS2005). The date format is yyyy/mm/dd however, when i put the code to...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.