I am looking at the OCIDateTimeToText funciton you (Sunnycoder) suggested. It appears this is a type of Oracle interface function that can be called within a C program.
For converting a timestamp to GMT time I have been looking via the internet to see what's out there and came across the NEW_TIME datetime function in Oracle that can be used with a Select statement which I'm also looking at.
Currently our environment has oracle data bases at each of our warehouse sites and we are looking at Oracle's replication tool for making changes to the data. As part of our conflict resolution process we want the latest transaction to take precedent if two different sites are changing the same table record. Since all of our sites are spread across different time zones we wanted a common timestamp that could be used for all sites making changes via our application which is why I'm looking at GMT time. I want to retrieve the current date timestamp and convert it to GMT time before storing on the Oracle table. That way replication transactions between the different sites will be able to compare transaction times and use the latest transaction time if there is any conflict resolution involved.
Let me know what you think about using the NEW_TIME timestamp function in Oracle to accomplish this. The only problem with this function is you have to pass the timezone name (PST,CST,EST) as one of the parameters. I can retrieve the timezone offset (-7:00,-4:00,etc) via the systimestamp Oracle function and then mannually convert it to PST, CST, etc.
Ex. select to_char(NEW_TIME (Systimestamp,'PST', 'GMT'), 'YYYY-MM-DD HH:MI:SS AM') from dual.
thanks
Main Topics
Browse All Topics





by: sunnycoderPosted on 2008-09-22 at 20:49:12ID: 22546288
Use OCIDateTimeTOTExt API com/docs/c d/B28359_0 1/appdev.1 11/ b28395/ oci19map00 2.htm#i509 197
http://download-uk.oracle.
OCI should be installed.