how to add minutes to timestamp?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: how to add minutes to timestamp?

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    1

    how to add minutes to timestamp?

    hii,

    I have an integer value "minute" which needs to be added to a timestamp ...
    I have no great experience with timestamp and dont know how to make it...

    is it possible to convert to timestamp to minutes and than add minutes to converted timestamp, and after this convert the final value to the timestamp...


    I will be very appreciated with sample code..
    Thanks..

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Just compute the minutes and the timestamp as milliseconds and add them.
    Code:
    long t=theOldTimeStamp.getTime();
    long m=minutes*60*1000
    
    TimeStamp theNewTimestamp=new TimeStamp (t+m);

Similar Threads

  1. Help please !urgent!
    By Ana in forum Java
    Replies: 11
    Last Post: 10-24-2009, 09:54 AM
  2. Replies: 0
    Last Post: 07-19-2002, 01:41 AM
  3. Replies: 0
    Last Post: 06-12-2002, 10:59 AM
  4. Displaying XML Data using .Net Controls
    By Greg Rothlander in forum ASP.NET
    Replies: 1
    Last Post: 11-27-2001, 06:09 PM
  5. How to add blank date to recordset??
    By Mark Burns in forum VB Classic
    Replies: 2
    Last Post: 02-26-2001, 12:48 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center