Timestamp calculation function
<p>I am trying to write Java code as a part of my project to get current time for a process and then i need to add a fixed timeout period to it. This new time has to be compared with my above currenttime and take decision based on that. I am not able to add time to the currenttime and compare it. Can anyone help me by suggesting a way?</p>

<p>This is my code:</p>

<pre><code>   public class SessionDetails
    {
     public String getCurrentUtcTimestamp() {
        TimeZone timeZone = TimeZone.getTimeZone("UTC:00");
        DateFormat dateFormat = DateFormat.getDateTimeInstance();
        dateFormat.setTimeZone(timeZone);
        timeStamp = dateFormat.format(new Date());
        return timeStamp;
    }
     public void createSession()
         {
           int value = getsession();
           String timeStamp = getCurrentUtcTimestamp() ;
           System.out.println("New session Details :");
           System.out.println("session value:" + value);
           System.out.println("Time of creation :" + timeStamp );
         }
    public boolean checkTimeout(int value)
        {   
            private static long c_Timeout = 10000;
            String currentTime =  getCurrentUtcTimestamp() ;
            if ( currentTime &gt; timeStamp + c_Timeout )   //failing to implement this logic efficiently .please do suggest a way.Thanku..
             System.out.println("Sorry TimeOut");
           else 
             System.out.println("Welcome");

        }
 }
</code></pre>
