User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,868 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,503 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 3997 | Replies: 2
Reply
Join Date: Nov 2005
Posts: 1
Reputation: jgoering is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jgoering jgoering is offline Offline
Newbie Poster

I just need TIME not Date.

  #1  
Nov 6th, 2005
I'm working on a project that just needs to know that its 08:00 or 14:01. I dont need or want to store anything about date.

When I store the time and then try to check it against the current time I'm runnig into problems.

where (timeofevent = Convert(char(19),current_timestamp))

this doesnt work because Convert(char(19),current_timestamp
returns Nov 6 2005 6:39PM when what I need is 6:39PM or 18:39.

I need help getting the current time in that format.

THANKS!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2005
Location: Dubai,UAE
Posts: 36
Reputation: noman78 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
noman78's Avatar
noman78 noman78 is offline Offline
Light Poster

Re: I just need TIME not Date.

  #2  
Nov 23rd, 2005
u can use combination of SubString and instr function and can extract time from the date-time stamp
if is wht u wnat get back to me, i will give u the example
Reply With Quote  
Join Date: Aug 2008
Posts: 5
Reputation: AntonioGK is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
AntonioGK AntonioGK is offline Offline
Newbie Poster

Re: I just need TIME not Date.

  #3  
7 Days Ago
Hello,

This expression give you only the time.
CONVERT (varchar, GETDATE(), 114)
-- this is the result
-- 10:24:55:640



I hope this help you.
Last edited by AntonioGK : 7 Days Ago at 1:28 pm. Reason: Add Result
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 6:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC