Solved

ColeDateTime access to sub-second values

Posted on 1997-08-09
5
866 Views
Last Modified: 2013-11-19
Using OBDC I can record data with timestamps down to 1
millisecond. What is a nice, clean way of creating a timestamp of the format YYYY-MM-DD HH:MM:SS.SSS from
an COleDateTime object?
0
Comment
Question by:rocco
5 Comments
 
LVL 4

Expert Comment

by:davmarc
ID: 1303463
Sorry, COleDataTime doesn't support milliseconds.
I can store timestamps with a precision down to 1 second.

Davide Marcato.
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1303464
Argh! Many apologies, I posted a stupid and wrong answer!
Please ignore and reject it...

Davide Marcato.
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1303465
Use COleDateTime::Format("%Y-%m-%d %H:%M:%S") which returns a CString. Take a look at the online help for COleDateTime::Format to see what other formatting options you can use.
0
 

Author Comment

by:rocco
ID: 1303466
This is fine for second resolution. The does not appear to
be a format character for milliseconds.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1303467
COleDateTime doesn't support sub-second resolution.  (The documentation is wrong in saying that it does.)

You'll need to use the TIMESTAMP_STRUCT data type if you want subsecond precision. The fraction field in this structure has resolution to a billionth of a second.

.B ekiM



0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Rewrite URL With Encoded Characters 6 75
mapAB Challlenge 35 128
unix example issues 18 76
"Black Box" Testing of Control System Software 2 26
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now