473,503 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Format(Now, Milliseconds)?

Hi,

Is there a way to format a date like this: Format(Now,
"HH:mm:ss.Milliseconds")??

I knwo I can use the Now.Milliseconds-function, but it would be nicer to put
it in the Format-function too, but I can't fidn the abreviation for it?

Anybody can help me with this?

Thanks a lot in advance,

Pieter
Nov 20 '05 #1
2 23147
Hi Pieter,

I don't know about String.Format, but you can use

DateTime.ToString("HH:mm:ss:fff");

f is fraction of second, which essentially is milliseconds, fff to the nearest 1/1000.

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 20 '05 #2
* "Morten Wennevik" <Mo************@hotmail.com> scripsit:
I don't know about String.Format, but you can use

DateTime.ToString("HH:mm:ss:fff");

f is fraction of second, which essentially is milliseconds, fff to the nearest 1/1000.


In addition to that, I recommend to have a look at the according
chapters of MSDN:

<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconformattingtypes.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

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

Similar topics

3
2159
by: Ed | last post by:
Hi there, My problem is the following: When I assign a custom formatted Date & Time to a Date variable it loses it’s formatting. Ex. 2005-06-07 15:46 now when I assign this to a variable of...
4
1954
by: | last post by:
Hi all, i need to display the day in a text box. what is the code for getting Day(Now) to be displayed in
6
8822
by: Starbuck | last post by:
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...
6
2494
by: Laurence | last post by:
In VS.2005 using VB.NET I have tried to make a string dim abc as string abc = format(now,"mm/dd/yyyy") or abc format$(now,"mm/dd/yyyy") but it doesn't work.
15
1369
by: Rob | last post by:
In order to create a date in CCYY-MM-DD fashion, I used to be able to use the Format(date,"yyyy")&"-"&Format(month,"mm")... syntax... This no longer appears to work in vb.net. I know how I...
8
5515
by: Thunder | last post by:
Hi All, I'm using VB.Net 2005. I have for years used Format to format strings and dates, etc... Now when I try to use Format I get the following error? "'Format' is a type and can not be used...
2
1041
by: fastlerner | last post by:
I writing a simple app using VB 2005 for my WM device (Treo 750 WM6). I'm using something like this: myString = Format(Now, "h:mm:ss.fff tt") When I run this code in my windows version of...
16
38229
by: neelsfer | last post by:
I need to add milliseconds to this finishtime of race !!! = Format(Now(), "General Date") Start code for race also in milliseconds !!! = Format(Now(), "General Date") I will then subtract it...
14
3819
by: neelsfer | last post by:
I have a timing application. Now my clients want milliseconds accuracy added to it. I have two fields called timestart and timefinish. I manage to add milliseconds etc with a button from main form...
0
7205
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
7287
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
7348
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...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.