469,286 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

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 8704
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Christos TZOTZIOY Georgiou | last post: by
37 posts views Thread by WittyGuy | last post: by
6 posts views Thread by Drazen Gemic | last post: by
10 posts views Thread by Martin Vorbrodt | last post: by
6 posts views Thread by Miguel Guedes | last post: by
3 posts views Thread by dragonslayer008 | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.