Solved

ColeDateTime access to sub-second values

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 108
has77  challenge 9 90
sumHeights2  challenge 7 117
moto 4g phone enable finger print 4 28
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

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