473,324 Members | 2,254 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,324 software developers and data experts.

removing time from date format

2
hi,

i m facing a problem in getting the data from the database. actually i m setting a variable with the function getdate. but after setting it i just need the date part of it, not the time part. can anyone tell me how can i remove the time part from the variable. i m using the oracle database and java as front hand.
Feb 16 '07 #1
3 48025
MMcCarthy
14,534 Expert Mod 8TB
hi,

i m facing a problem in getting the data from the database. actually i m setting a variable with the function getdate. but after setting it i just need the date part of it, not the time part. can anyone tell me how can i remove the time part from the variable. i m using the oracle database and java as front hand.
This sounds more like a Java question than Oracle. If you need the syntax for formatting a date in Java you might do better posting this question in the Java forum.

Mary
Feb 20 '07 #2
Maybe it helps:

select to_char(sysdate, 'DD/MM') from dual
select to_char(sysdate, 'DD/MM/YY') from dual
select to_char(sysdate, 'DD/MM/YYYY') from dual

This sounds more like a Java question than Oracle. If you need the syntax for formatting a date in Java you might do better posting this question in the Java forum.

Mary
Feb 23 '07 #3
try this :)
select trunc(sysdate) from dual;
You will get date without time.
Feb 28 '07 #4

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

Similar topics

1
by: Shaiboy_UK | last post by:
Hi All, Sorry if this is the wrong newsgroup to post into, on this topic, if so, please point me in the right direction..... Currently working on a ASP for a friend, which requires the date...
2
by: Ian | last post by:
I have a problem I hope someone can point out where I am going wrong. I need to store a date/time in a cookie ( ie the date a visitor last visited ) However the date format changes to US, despite...
15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
4
by: Paul | last post by:
Hi, Everything went fine getting a short date format out of SQL into my DataGrid with this: <%# DataBinder.Eval(Container.DataItem, "Created", "{0:d}")%> Then I got too fancy in SQL and...
3
by: Curtis | last post by:
I am trying to convert a string to datetime format and I get an invalid Date/Time format error. The code I am trying to use is: msgtime = CDate("Sat, Aug 27 2005 20:00:00 EDT") I know I can...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
2
by: savigliano | last post by:
hello, i am doing a date comparation and i have reallize that the data i have in my database (general date format) it is causing me problems, and because i don´t need the time data i would like to...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
3
by: Tony WONG | last post by:
The date format (control panel) of testing (VS2005) and production platform are yyyy/mm/dd. i run preview from testing (VS2005). The date format is yyyy/mm/dd however, when i put the code to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.