Re: How do you pass C time_t datetime to Oracle?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/05/01
Message-ID: <957173205.17324.0.pluto.d4ee154e_at_news.demon.nl>#1/1


date columns are treated a strings in C.

Hth,

Sybrand Bakker, Oracle DBA

Don Chambers <dchamber_at_mindspring.com> schreef in berichtnieuws ikqpgs8m3pcqp0lmr91cihte57tv1pb9sn_at_4ax.com...
> I am writing my first C++ UNIX program that uses an Oracle database.
> I am writing the middle tier componet and am having trouble with
> datetime values.
> .
> I will be passed a time_t and must return a time time_t. I am not
> able to get the time_t into the database as a DATE or select a
> date/time and covert it to the time_t.
>

> Can I insert this format into Oracle directly? I could not find this
> format for the TO_DATE function.
>
> How do you handle this?
>
> I have written a couple functions to do the conversions using a
> variety of methods and seem to be off because of time zones. I would
> think that this is a common task and should be relativly easy.
>
> This time_t variable comes from a windows system where the time is
> actually an unsigned long that is the number of seconds from Jan. 1,
> 1970 00:00:00. In the middle tier I am using Pro*C/C++. Does pro C
> provide a conversion for this?
>
>
> Thanks,
> Don
> chambers_at_inquiregroup.com
>
Received on Mon May 01 2000 - 00:00:00 CEST

Original text of this message