Tuesday, August 4, 2009

Remove time in java.sql.Date using sql

to_char(disconnected_on,"%Y-%m-%d")

Here "disconnected_on" is the field in the table. If you use to_char() method it will remove time values and formate the date as "YYYY-MM-DD".

Ex :-
before use :- 2009-10-10 12:09
after usage :- 2009-10-10

No comments:

Post a Comment