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

pure vb.net format question

Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance
Nov 21 '05 #1
6 8820
TextBox1.Text = Format("dd/mm/yy", DateTime.Now.ToShortDateString)

HTH

Regards Terry Burns

http://TrainingOn.net



"Starbuck" <ke*@kevsbox.com> wrote in message
news:O3*************@tk2msftngp13.phx.gbl...
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance

Nov 21 '05 #2
All you need to do is

now.tostring("d")

This will use the regional setting to display a short date. But if you want
to hard code the format use

now.tostring("dd/MM/yyyy")

I hope this help

Jon

Hello Starbuck,
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example
Thanks in advance


Nov 21 '05 #3
DateTime.Now.ToString("dd/MM/yyyy")

Chris.

"Starbuck" wrote:
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance

Nov 21 '05 #4
Thanks guys

Best Regards
"Chris Podmore" <Ch**********@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
DateTime.Now.ToString("dd/MM/yyyy")

Chris.

"Starbuck" wrote:
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance

Nov 21 '05 #5
Sorry, this is one way of doing it.

TextBox1.Text = Format(Now, "dddd, MMM d yyyy")
--
Terry Burns
http://TrainingOn.net
"Mr Newbie" <se*****@sdfsdf.com> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
TextBox1.Text = Format("dd/mm/yy", DateTime.Now.ToShortDateString)

HTH

Regards Terry Burns

http://TrainingOn.net



"Starbuck" <ke*@kevsbox.com> wrote in message
news:O3*************@tk2msftngp13.phx.gbl...
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance


Nov 21 '05 #6
Thanks Terry
"Terry Burns" <us@ourWebSite.com> wrote in message
news:uN**************@TK2MSFTNGP14.phx.gbl...
Sorry, this is one way of doing it.

TextBox1.Text = Format(Now, "dddd, MMM d yyyy")
--
Terry Burns
http://TrainingOn.net
"Mr Newbie" <se*****@sdfsdf.com> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
TextBox1.Text = Format("dd/mm/yy", DateTime.Now.ToShortDateString)

HTH

Regards Terry Burns

http://TrainingOn.net



"Starbuck" <ke*@kevsbox.com> wrote in message
news:O3*************@tk2msftngp13.phx.gbl...
Hi All

Is there an pure vb.net way of doing the following.

Imports Microsoft.VisualBasic
Format(Now, "dd/mm/yyyy")
Which will return date in string format of 11/02/2005 for example

Thanks in advance



Nov 21 '05 #7

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

Similar topics

15
by: Christos TZOTZIOY Georgiou | last post by:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please let me know, since I can't test a couple of my apps using PIL with 2.4 . You can even reply by email (yes, I dare use true...
37
by: WittyGuy | last post by:
Hi, I wonder the necessity of constructor and destructor in a Abstract Class? Is it really needed? ? Wg http://www.gotw.ca/resources/clcm.htm for info about ]
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
6
by: Drazen Gemic | last post by:
Is there any initiative out there aiming to rewrite PHP extensions in pure PHP ? For example, MySQL driver in pure PHP or LDAP extension in pure PHP ? With Java and, as far as I know, Perl, one...
10
by: Martin Vorbrodt | last post by:
Example code in one of my books intrigues me: class B { public: B* Clone() const { B* p = DoClone(); assert(typeid(*p) == typeid(*this)); return p; }
2
by: ChrisO | last post by:
I've been pretty infatuated with JSON for some time now since "discovering" it a while back. (It's been there all along in JavaScript, but it was just never "noticed" or used by most until...
6
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
3
by: dragonslayer008 | last post by:
I am building a control library in C++/CLI. My project links with a native library and am getting an error that the library cannot work with pure: dxerr.lib(dxerr.obj) : fatal error LNK1313:...
14
by: Jack | last post by:
Hi, I meet a question with it , I did not get clear the different betteen them, for example: #include <iostream>
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.