Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How do you pass C time_t datetime to Oracle?
In article <ikqpgs8m3pcqp0lmr91cihte57tv1pb9sn_at_4ax.com>,
Don Chambers <dchamber_at_mindspring.com> wrote:
> 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
>
see http://osi.oracle.com/~tkyte/Misc/CTime.html
-- Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries http://osi.oracle.com/~tkyte/index.html -- Opinions are mine and do not necessarily reflect those of Oracle Corp Sent via Deja.com http://www.deja.com/ Before you buy.Received on Mon May 01 2000 - 00:00:00 CDT
![]() |
![]() |