Solved

ColeDateTime access to sub-second values

Posted on 1997-08-09
5
863 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

11 Experts available now in Live!

Get 1:1 Help Now