472,371 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 8782
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>
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.