Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:29:27+00:00 2026-06-04T16:29:27+00:00

I have a need to take a time period, e.g. a week and break

  • 0

I have a need to take a time period, e.g. a week and break it down into days and then further down into either hours, 30 minutes, 15 minutes etc.

Then I want to be able to assign (possibly multiple) people to those time spans.

e.g.

30 May 2012

0700 : 0730 – Alice, Bob

0730 : 0800 – Alice

…. : ….

1930 : 2000 – Alice

31 May 2012

0700 : 0730 – Carol

0730 : 0800 – Carol

…. : ….

1930 : 2000 – Carol

Where the start times and end times each day are customisable.

I need to be able to sort the working periods and do query them to see if any don’t have a person assigned to them. Check over a Day / Week that no one person is assigned to > x hours.

I know .Net has TimeSpan and DateTime but these seem cumbersome to use for what is a seems like a simple representation of some data and TimeSpan has no StartTime, it’s purely just a span of time (e.g. 30 minutes, 5 minutes, 1 hour etc).

What I had initially in mind was to create a class called WorkingDay, a WorkingDay can have a number of WorkingPeriods. a WorkingPeriod has a StartTime and EndTime and a List of people assigned to that WorkingPeriod with simple methods to AddPerson and RemovePerson.

WorkingDay will have a function to get a list of people assigned for that day by running through the WorkingPeriods and pulling out all unique people that are assigned for any period. It will also have a function that pulls out all WorkingPeriods with no-one assigned.

This seems far too cumbersome though! Especially as I’m going to need something else that takes in a number of WorkingDays and checks that the total time someone is assigned over multiple days is less than x hours etc.

Any suggestions for a good structure for this ? Is their an existing .Net Structure that will provide this which I’m missing ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:29:29+00:00Added an answer on June 4, 2026 at 4:29 pm

    The most direct (and compact) representation for a timeslot is DateTime start, TimeSpan duration.

    That lends itself well for querying, less well for setting up and validating (against overlap etc).

    The next option is to divide each day (or week) into a fixed number of periods, define those periods once and code each timeslot as DateTime base, int PeriodId. Better for finding empties and duplicates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a homework assignment where I need to take input from a file
I need to take a url, /ServiceSearch/r.php?n=blahblah, and have it go to /search/blahblah/ so
I have an int[] array. I need to take an int and append it
This is my first post here. I have a problem. I need to take
I have a task I need to perform, do_stuff(opts) , that will take ~1s
I have need to pack four signed bytes into 32-bit integral type. this is
I have a need to take in a list of ID numbers corresponding to
I basically need to have take some videos information out of a database with
I have a initiative where I need to take in documents and convert them
I have some functions that I am calling and they take some time (milliseconds),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.