- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Convert char time stamp to date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 07:26 AM
тАО04-25-2006 07:26 AM
Convert char time stamp to date
It it listed in the database as:
Basically an appt. end time.
2030 0830 PM
This is one field. Basically two time stamps meaning the same thing. First is in 24 hr time, and the second is in 12 time.
We would like to convert this data type to a day format. And just stick with first heading of 24 hr time stamp. (2030)
When it was tried it change it to a date stamp of April 1/06
How would you convert this char data type to just a time stamp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 09:10 AM
тАО04-25-2006 09:10 AM
Re: Convert char time stamp to date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 09:35 AM
тАО04-25-2006 09:35 AM
Re: Convert char time stamp to date
We would like it to be HH24:MN
But 2030 0830 PM some how gets converted to April 1/06
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 10:27 AM
тАО04-25-2006 10:27 AM
Re: Convert char time stamp to date
perl -p -e '/^(\d\d)(\d\d) / && print "$1:$2\n"' yourolddata.txt
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 08:15 PM
тАО04-25-2006 08:15 PM
Re: Convert char time stamp to date
The Oracle date type is used to store full dates (i.e. year,day,moth,hour,minute,second)
If your database only has the time stored, all the data is for the same day?
If so you could do hardcode:
select to_date('26/04/06 '||substr(field1,1,4),'DD/MM/YY HH24MI') from test;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 08:28 PM
тАО04-25-2006 08:28 PM
Re: Convert char time stamp to date
select to_char(sysdate,'DD/MM/YY-HH24:MI') from dual
(Replace sysdate by your column and dual with your table, but you can use the above example to test your format)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2006 10:05 PM
тАО04-25-2006 10:05 PM
Re: Convert char time stamp to date
Also is there an DD-MON-YYYY part to this or is it not required?
The to_char(colname,'HH24:MI') will be ok or in a table colname DATE "HH24:MI" should work.
Hope this is helpfull.
kyris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2006 08:50 PM
тАО04-27-2006 08:50 PM
Re: Convert char time stamp to date
could you please update the thread. Any progress/solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2006 12:49 AM
тАО04-28-2006 12:49 AM
Re: Convert char time stamp to date
You may want to simply do this 'all the time' on retrieval (through a view?) or conveert the table adding a new column, sturing the calculated values in that column, and dropping the old varchar holding the funky time string.
My choice woudl probably a fresh create table as...
Rename the tables when done.
Good luck,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2006 01:34 AM
тАО04-28-2006 01:34 AM