473,467 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how can i get time only in date data type

5 New Member
hey there,
i m trying to get only time information of a date type variable.
i got a column in type of char, it keeps time info in hh:mm format - 5 characters
when i tried to convert it to date with to_date([variable], 'hh24:mi') it gives me a date starts with the ifrst day of current mount, year etc.
01/10/2008 14:04 for example.

i need a solution to get time info in date data type from a char column in hh:mm

thanx for ypur care...
Oct 20 '08 #1
6 11422
amitpatel66
2,367 Recognized Expert Top Contributor
Your requimrent is not clear.Are you trying to convert the char data in to time format or are you trying to extract a time from a current date?
Oct 20 '08 #2
gozdeata
5 New Member
i m trying to convert char data (for example 15:30) into date data type.
to_date('15:30','hh24:mi') function gives it to me with a date that belong to first day of the current mount. for example as 01/10/2008 15:30 i f we cosider today. i need only time info.
thanks for your care...
Gözde
Oct 21 '08 #3
debasisdas
8,127 Recognized Expert Expert
You can store both date a dnd time in a date value .Which can later be extracted as desired for any processing or rerporting purpose.
Oct 21 '08 #4
amitpatel66
2,367 Recognized Expert Top Contributor
i m trying to convert char data (for example 15:30) into date data type.
to_date('15:30','hh24:mi') function gives it to me with a date that belong to first day of the current mount. for example as 01/10/2008 15:30 i f we cosider today. i need only time info.
thanks for your care...
Gözde

Use TO_CHAR(column_name,'HH24:MI') or TO_CHAR(TO_DATE('15:30','HH24:MI'),'HH24:MI')
Oct 21 '08 #5
gozdeata
5 New Member
Use TO_CHAR(column_name,'HH24:MI') or TO_CHAR(TO_DATE('15:30','HH24:MI'),'HH24:MI')
sorry that i think i couldn't explain my problem clearly
above fınctions gives it to me as character. i need time info in date type. when i use to_date() with 'hh24:mi' it gives me with an unwanted date info. i need only time...
Oct 22 '08 #6
debasisdas
8,127 Recognized Expert Expert
try to use EXTRACT function.
Oct 22 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Yong Wang | last post by:
> Hi: > We have a database system. In the database, we have an > attribute called date0, which contains date data (format: > i. e. 2004-08-12). I wrote a script to fetch the data > in a...
1
by: John Cosmas | last post by:
I've encountered a table that stores dates in Gregorian format so that the dates and time looks like straight integers that cannot be easily discrened as a date or time by just looking at it. I'm...
2
by: Remi Caron | last post by:
Hi, I took over an Visual Object project (Visual Clipper) in that language there is a function to: Convert a string containing a 32-bit binary date to a date data type. That function is called...
1
by: Alan | last post by:
Any data type that I can use to store date ?
1
by: glenn | last post by:
Hi folks, I am doing an UPDATE to a table that has a field for a DATE data type. I am using MS Access. The UPDATE works fine but when I try to place the DATE field in the mix it blows up. ...
3
by: glenn | last post by:
Hi folks, I have 2 code snippets. One works and one does not. This first hard-coded snippet works Dim queryString As String = "UPDATE SET = '8/16/2006' WHERE (. = @id)" This second...
2
by: shubhangi | last post by:
Hi, I want to enter only time from frontend & not date time. Can I do this & can I store this in DB. If yes, what will be data type to store only time values. How do I retrieve the time data in...
4
by: loisk | last post by:
Hi, I need to compare a date (on a form )entered by a user with today's date and a date should not be greater than today. The problem, however, the data type for the date is string, not date date...
6
by: dkyadav80 | last post by:
Hi guys, I have a form in html , all description below: first: name of persion (input type box) second: job profile (input type box) third: experience from: list box (Month : Jan, Feb,.....
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.