Results 1 to 3 of 3

Thread: Timestamp Issue

  1. #1
    hacktorious is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Perhaps the problem is in the Timestamp class itself. You're not using any static variables in that class, are you?

  3. #3
    hacktorious is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    That was strange... Just a simple reboot. Sheesh, I spent a long time trying to figure that one out. Good Grief!!! What the heck could have caused that mess?

Similar Threads

  1. To_date function through Java shows timestamp
    By mpavithra in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-29-2010, 08:59 AM
  2. Replies: 3
    Last Post: 07-22-2010, 12:28 PM
  3. how to compare two timestamp
    By baktha.thalapathy in forum New To Java
    Replies: 1
    Last Post: 06-11-2010, 10:05 AM
  4. Timestamp in SQL format
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-10-2008, 11:37 AM
  5. Date as String to TimeStamp
    By ironballs in forum Advanced Java
    Replies: 1
    Last Post: 08-01-2007, 01:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •