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

.Net Equivalent to VB6.Format?

3
I'm trying to upgrade an application from VB6 to VB.Net (2.0) and I was wondering if there is something that I can use in VB.Net that is similar to VB6.Format?

I have this in my code: VB6.Format(Now, "MM/DD/YYYY HH:MM:SS"). Is there another way I can do this? Thanks.
Oct 3 '06 #1
2 9775
if you're trying to convert a DateTime object type to a string using that format it's real easy, try out this.

DateTime.Now.ToShortDateString();
or DateTime.Now.ToShortTimeString();
or DateTime.Now.ToString();

the DateTime object in .NET 2.0 has a lot of functionality built into it. Making a our jobs as developers ridiculously easy.
Oct 6 '06 #2
Another way to do it is writing the format string directly, as a parameter for ToString method:

DateTime.Now.ToString("mm/dd/yyyy hh:mm:ss");
Nov 8 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bruce | last post by:
I have an application where I would like to be able to allow the user to specify the date format used throughout the program (for internationalization). Then, on a date entry field, I can...
0
by: Josiah Carlson | last post by:
Good day everyone, I have produced a patch against the latest CVS to add support for two new formatting characters in the struct module. It is currently an RFE, which I include a link to at the...
1
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
22
by: John Phung | last post by:
Is there a fscanf equivalent for c++? Here's what I'm talking about: unsigned int NextAddress(ifstream& AddressFile) { unsigned int next_address; -->How do I rewrite the fscanf listed below...
5
by: siliconwafer | last post by:
Hi All, What does a 'format specifier' do? Suppose I do, int a = 43; //decimal number printf("%x",a); I will get hex equivalent of 43. Does the format specifier do an implicit "decimal to hex"...
2
by: Sunkam Santhoshi | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
5
by: A.M | last post by:
Hi, I have a datetime value and want to format it to "June 1, 2006" shape. How can I do that? Thank you,
3
by: stathisgotsis | last post by:
Hello everyone, Trusting K&R2 i thought until recently that spaces are ignored in scanf's format string. Reading arguments to the contrary confused me a little. So i now ask: Is...
6
by: openopt | last post by:
Thank you in advance for your response. Dmitrey
44
by: A.Leopold | last post by:
hello, is there a c++ equivalent function to the c-function 'sprintf'? Thank you, leo
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.