0
public Integer countWeekday(Date startDate) {

        startDate.setHours(0);
        startDate.setMinutes(0);
        startDate.setSeconds(0);

    }

I have this function and a parameter passed to it.
setHours,setMinutes and setSeconds are deprecated.
What else can i use?

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by mKorbel
0

Use java.util.GregorianCalendar instead of Date.
This class does days, weeks, months etc properly, and is the reason why the old methods in the Date class were deprecated.

ps: When you look at the javadoc for GregorianCalendar you'll find all the interesting methods are inherited from the abstract class Calendar, so don't forget to look there as well.

Edited by JamesCherrill: ps

0

What is the format of date and time when you insert into Oracle Database?
At me, only dis format works. eg : 14-FEB-2011

1

@lili.edryana

hmmmm as I see you totally ignored more that 100.examples about Date & Calendar, good to know

on pages that I send link is complete Sql-92 + Oracle-Sql manual

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.