473,404 Members | 2,174 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,404 software developers and data experts.

Format String: Hundredth of a second

How can I display the hundredth of a second or which is the correct format
string?

I use now {0:yyyy-MM-dd HH:mm:ss} and this display the following
information:

2004-08-04 21:49:21... But I want to display the hundredth of a second
too...

Regards,

Özgür Aytekin (MCSD .NET, MCDBA)

www.borsagame.com


Nov 16 '05 #1
3 3213
Make your format string {0:yyyy-MM-dd HH:mm:ss.ff}

Tom Dacon
Dacon Software Consulting

"Özgür Aytekin" <oe******************@spam.dotnetcracks.com> wrote in
message news:uW**************@TK2MSFTNGP11.phx.gbl...
How can I display the hundredth of a second or which is the correct format
string?

I use now {0:yyyy-MM-dd HH:mm:ss} and this display the following
information:

2004-08-04 21:49:21... But I want to display the hundredth of a second
too...

Regards,

Özgür Aytekin (MCSD .NET, MCDBA)

www.borsagame.com

Nov 16 '05 #2
Özgür Aytekin <oe******************@spam.dotnetcracks.com> wrote:
How can I display the hundredth of a second or which is the correct format
string?

I use now {0:yyyy-MM-dd HH:mm:ss} and this display the following
information:

2004-08-04 21:49:21... But I want to display the hundredth of a second
too...


Use

{0:yyyy-MM-dd HH:mm:ss.fff}

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3
Jon Skeet [C# MVP] <sk***@pobox.com> wrote:
Özgür Aytekin <oe******************@spam.dotnetcracks.com> wrote:
How can I display the hundredth of a second or which is the correct format
string?

I use now {0:yyyy-MM-dd HH:mm:ss} and this display the following
information:

2004-08-04 21:49:21... But I want to display the hundredth of a second
too...


Use

{0:yyyy-MM-dd HH:mm:ss.fff}


Oops - one too many fffs - the above will give you thousandths of a
second.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

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

Similar topics

3
by: Lowell Kirsh | last post by:
In Peter Norvig's Infrequently Answered Questions he explains that the following 2 fnctions look almost identical but are not the same: def printf(format, *args): print format % args, def...
5
by: raffelm | last post by:
I'm struggling to find a way to include long path names in a command line argument string that I have to build at runtime. I need to create a string like -o:"c:\my documents\my file.txt". ...
1
by: Ugur Ekinci | last post by:
Hi , I have two Sql Server 2000 on seperate machines , First one accepts datetime format like ("dd.MM.yyyy hh:mm:ss") And Second one accepts datetime format like ("MM.dd.yyyy hh:mm:ss") 1-...
11
by: shsandeep | last post by:
I used the following query to retrieve the date in dd-mon-yyyy format. db2 => SELECT RTRIM(CHAR(DAY(COVG_TYP_STRT_DT))) || '-' || RTRIM(MONTHNAME(COVG_TYP_STRT_DT)) || '-' ||...
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...
5
by: The Pipe | last post by:
Hello I have a table that I need to export to a .asc file format. I have had several attempts at getting this to work but with no luck. Basically the file would need to have every record...
1
by: raylopez99 | last post by:
Here is an example of a home grown generic class, representing a pair of values. Adapted from Jon Skeet's book "C# In Depth". The generic class is "sealed" for some reason (I think for...
30
by: Adam | last post by:
Hi, I have a simple printf-like function: int print(const char *format, ...) { char buffer; va_list argptr; int i;
12
truthlover
by: truthlover | last post by:
I have a problem that's difficult to explain, so please be patient. The database is in 2000 format, though I'm doing most of the designing in 2007 (saved as 2000 format, of course) I have a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.