473,396 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Convert timestamp to date

Bob
Trying to convert timestamp data to date data (without the time in
hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd').

But I do not want a string, but a real date like 29-03-2005.

How do I get it like that?

Thanks,
Bob
Jul 19 '05 #1
1 59995
Bob wrote:
Trying to convert timestamp data to date data (without the time in
hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd').

But I do not want a string, but a real date like 29-03-2005.

How do I get it like that?


1) try the trunc function, i.e. "select trunc(sysdate) from dual;"

2) try re-converting your string back to a date, i.e.
"select to_date(to_char(mydate,fmt1),fmt2) from dual;"
using appropriate format strings for fmt1 and fmt2.

3) Or maybe I don't really understand what you're trying to do. What do
you mean by "timestamp data" as opposed to "date data"?

--
//-Walt
//
//

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
1
by: Sugapablo | last post by:
How do you convert a unix timestamp to date('Y-m-d H:i:s')?
2
by: Russell Smith | last post by:
Timestamps support infinity. However if appears dates do not. When timestamps are cast to dates, there is no output. Is this an acceptable option or not? Below are a number of examples...
10
by: satishrajana | last post by:
Hi, My SQL returns a NULL in a datefield if there is no date in that field. If there is a NULL in this column, I want to replace it with spaces in my SELECT statement when I am selecting these...
5
by: whitsey | last post by:
Hi, I can easily convert a TIMESTAMP to a DATE which will give me results in the format 'DD/MM/YYYY' however, what I want to do is convert the TIMESTAMP to just 'MM/YYYY' or even better...
1
by: mohini2000 | last post by:
Hi I want to convert timestamp forrmat to date. For eg: Suppose I give timestamp format on Console as MM/DD/YYHH:mm:ss. Output should be: 08/24/0714:34:32 If I give MM/DD/YYTHHmmss Output...
1
by: sebasC | last post by:
the code below is used on a site to show time in multiple time zones on the website what i need is to convert the php code below to asp so that it will work. because the clock shows on the site but...
4
by: skulkrinbait | last post by:
Hello How can I convert a date into the Unix timestamp? I don't really mind what format the date is in, something like MMDDYY would be fine, can someone show me what code I would need to do...
1
by: Bob | last post by:
Trying to convert timestamp data to date data (without the time in hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd'). But I do not want a string, but a real date like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.