Main Topics
Browse All TopicsI need a function like to_date or to_char that converts a sysdate to such a formate:
Mon Aug 03 09:49:48 GMT 2009
i'm using this one:
select to_char(systimestamp, 'Dy Mon DD HH24:MI:SS YYYY') as "Current Time"
from dual;
The problem is the GMT, i can't get it :(.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you for the quick answare:
I already trid tthat: the problem is that i have a table that saves data from a strange application. in the table a have a column called Date, but column type is varchar and the date that are saved have this formate:
Mon Aug 03 09:49:48 GMT 2009
the qustion is if i select this column from the table and compare it with another oracle datae such a sysdate, how could i do it??
your select which i already have trid giveng me:
Ons Aug 05 16:28:03 +02:00 2009
that +02:00 is different from GMT withc is the name of time zone.
It appears you are trying to go the opposite of your original post. You have a string in that format and you want to convert it to an Oracle timestamp.
This should work, although messy. The mess comes from converting GMT to the local time zone. GMT didn't seem to be recognized by the TZD format element, so I used replace to change it to the offset for GMT, which is 0.
thank you johnsone for your answar: your query is failing with ORA-01846!
Thank you all for good answares, the reason of i'm asking my qustion in this way is because i need to create a table wich have column that is a sysdate or systimestamp type. Then i want to insert this String (Mon Aug 03 09:49:48 GMT 2009) to the coulmn in away that Oracle can understand it.
MarkusId and Andytw both of your querys helped me alot.
Hi,
So, I hope we get you right now:
You have a date which is currently stored in the database as
a characterfield as provided (Mon Aug 03 09:49:48 GMT 2009).
Now you want to take this column and store it as timestamp.
The remaining question is, do you want to save it keeping the
timezone or do you want to convert it to the current timezone?
Her is how i solved my problem:
insert into dato_test (dato) (select to_timestamp_tz(
replace(upper('Mon Aug 03 09:49:48 GMT 2009'), 'GMT','0:0'),
'DY MON DD HH24:MI:SS TZH:TZM YYYY') as GMT
from dual);
but insted of Mon i used Man to try it on mine computer, because my system is in Danish languge. And it was therfor johnsone's query was failling.
Business Accounts
Answer for Membership
by: AndytwPosted on 2009-08-05 at 06:48:53ID: 25023390
Try this:
Select allOpen in new window