• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 897
  • Last Modified:

ColeDateTime access to sub-second values

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
rocco
Asked:
rocco
1 Solution
 
davmarcCommented:
Sorry, COleDataTime doesn't support milliseconds.
I can store timestamps with a precision down to 1 second.

Davide Marcato.
0
 
davmarcCommented:
Argh! Many apologies, I posted a stupid and wrong answer!
Please ignore and reject it...

Davide Marcato.
0
 
Tommy HuiEngineerCommented:
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
 
roccoAuthor Commented:
This is fine for second resolution. The does not appear to
be a format character for milliseconds.
0
 
mikeblasCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now