Results 1 to 3 of 3
Thread: Timestamp Issue
- 12-19-2010, 05:51 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
Timestamp Issue
OK, this is very strange. I am trying to run the following method, and the newTimestamp is coming out with the same value as the origTimestamp when I call newTimestamp.getTime();
Any suggestions as to why this, or how this could possibly happen.
Even System.out statements when written in this method show that the numbers are identical.
Any suggestions, thoughts, comments???
Hmmm, maybe my brain is just fried from staying up too late again. Thanks.
public Timestamp addMinutes(Timestamp origTimestamp, int minutes) {
long t = origTimestamp.getTime();
long m = minutes * 60 * 1000;
Timestamp newTimestamp = new Timestamp(t + m);
return newTimestamp;
}Last edited by hacktorious; 12-19-2010 at 06:02 AM.
-
Perhaps the problem is in the Timestamp class itself. You're not using any static variables in that class, are you?
- 12-19-2010, 06:03 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
To_date function through Java shows timestamp
By mpavithra in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 07-29-2010, 08:59 AM -
Reading timestamp value from Oracle database using Java Spring
By sm123 in forum New To JavaReplies: 3Last Post: 07-22-2010, 12:28 PM -
how to compare two timestamp
By baktha.thalapathy in forum New To JavaReplies: 1Last Post: 06-11-2010, 10:05 AM -
Timestamp in SQL format
By Java Tip in forum Java TipReplies: 0Last Post: 02-10-2008, 11:37 AM -
Date as String to TimeStamp
By ironballs in forum Advanced JavaReplies: 1Last Post: 08-01-2007, 01:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks