View Full Version : automatic time change with sorting

05-19-2009, 09:16 AM
hi ,

i am building an application where client wants to list the activites
with name,starttime,endtime

I have the start time of the first item . and duration of all the activities. so i can build a list of activities.

How can i add the duration (in mins) in the time so that hours get automatically cgnaged like 10.20 +70 = 11.30 with am pm.

The client wants that user can change the duration of any item , move the order of item and system should automatically chnage the start time and end time of all the activities

Any idea how should i proceed

05-19-2009, 09:35 PM
Assuming this is a database-driven app, I'd store the name, start time and duration in minutes. You could store start time as a unix timestamp (seconds since 1970), then to figure the end time by adding the duration (which I assume is in minutes), i.e.

end time = start time + (60 * duration)

Then convert the end time back to a human-readable time for display.