This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Get the correct time from Date object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Get the correct time from Date object" Watch "Get the correct time from Date object" New topic
Author

Get the correct time from Date object

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 263
Hi,

I am working with Quartz Job Scheduler and get a Date object returned when rescheduling a Job. I want to show the exact time of this Date object, but it seems that something is going wrong. When I print out the time I got a totally wrong time:
Mon Dec 12 14:43:40 CET 2005

Below you see the code I use:


Can you help me please?
[ June 27, 2007: Message edited by: Jeppe Fjord ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

What Date did you set in the trigger you are trying to replace ?
Please add the following line before rescheduleJob :


[My Blog]
All roads lead to JavaRanch
Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 263
Originally posted by Satou kurinosuke:
What Date did you set in the trigger you are trying to replace ?
Please add the following line before rescheduleJob :


Alright the above System.out.println prints out the same result:
Mon Dec 12 14:43:37 CET 2005

I found out that this date is the start time (java.util.Date startTime) of my trigger. I was just convinced that scheduler.rescheduleJob, would return the time that the job was rescheduled and not the starttime being initiated.

~ Alright I got it. Thanks for your help :-)
[ June 28, 2007: Message edited by: Jeppe Fjord ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

Yep, it returns the start time
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Get the correct time from Date object
 
Similar Threads
Does jdk131-b24 has fix for DST 2007 ?
Output of time
awkward date string
String to Date...
error connecting to SQL Server 2005