Solved

ColeDateTime access to sub-second values

Posted on 1997-08-09
5
872 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 92
how to monitor remote shell execution on linux 9 100
maxBlock challenge 30 130
scoreUp challenge 14 63
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 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