Results 1 to 7 of 7

Thread: Time comparing

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Talking Time comparing

    I have a parameter table.
    One is the closing time.
    But user only type a number (6, 5,etc)
    how do i convert this number in order to compare with the current time?

  2. #2
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Time comparing

    One number to describe time?

    What do you mean?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Re: Time comparing

    6 means 6 o'clock A.M
    4 means 4 o'clock A.M
    14 meas 2 PM

  4. #4
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Time comparing

    Will this time be on the same day as the current day?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Re: Time comparing

    yes, on the same day as the current day

  6. #6
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Re: Time comparing

    the DateTime structure has some methods u can use to compare time, add time etc.

    have you looked into that yet?

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Time comparing

    DateTime.Today.AddHours(6) returns a DataTime structure representing 6 AM today. You can use similar expressions to get other dates and times which can be compared using DateTime.Compare().

Posting Permissions

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



Click Here to Expand Forum to Full Width