Results 1 to 2 of 2
Thread: Coercing DataTypes
- 07-09-2008, 05:56 PM #1Member
- Join Date
- Jul 2008
- Rep Power
- 07-09-2008, 06:59 PM #2
A way to find which class to use is to look at the API doc for the constructors and see how to get from a long to a Calendar. There might be a class that will span that gap.
Calendar cal = new Calendar(new ?????(long));
where ???? is the spanning class.
Since Calendar is abstract, you'll need to use a subclass.
Or perhaps there is a method in the class/subclass that takes an object that uses a long in its constructor:
Calendar cal = new Calendar().setTheDate(new ????(long));
You find these by looking thru the possible methods and classes and see how to get from long to Calendar.
Last edited by Norm; 07-09-2008 at 07:05 PM.