Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Thanked 9 Times in 9 Posts

    automatic time change with sorting

    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
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #2
    New Coder
    Join Date
    Jan 2008
    Thanked 3 Times in 3 Posts
    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.
    Web hosting by coders, for coders: php hosting - Magento eCommerce hosting - perl hosting - check us out!


    Posting Permissions

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