Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    53

    Unanswered: datetime format string for tenths of seconds?

    Strange question, maybe, but I can't find the format string to convert time in tenths of a second. In the specific case, I have a datetime coming in as a string in tenths of a second. I want to store that in the database using explicit conversion with to_date. I've got everything except the mask character for the tenths-every list of format codes I've found only lists them out to seconds.

    Thanks.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    A DATE datatype does not contain any fractions of a second.
    If sub-second granularity is required, then a TIMESTAMP datatype must be used.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2006
    Posts
    53
    Thanks. Weird thing is that the source is another Oracle database. Obviously the tenths is coming in via an implicit conversion when the data is passed thru the program. We're using Cold Fusion so I guess I'll look there for the answer.

    Thanks.

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    anacedent gave you the answer, there is NO need to check cold fusion. If you want to store fractional seconds in an oracle database, you MUST be using Oracle 9 or above and your MUST use a timestamp column, a Date type column can only store whole seconds. And if you want to convert a string to a timestamp column, then use

    TO_TIMESTAMP ('1999-12-01 11:00.00.2345', 'YYYY-MM-DD HH24:MI.SS.FFFF')
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •