check certian time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stormkid

    check certian time

    Hi Group, I'm trying to figure out a function that will check to make sure
    the user has not double entered a certain time frame for example I don't
    want them to be able to enter Mon 8:00 AM to 5:00 PM and Mon 9:00 AM to 1:00
    PM but it is ok for them to enter something like Tue 8:00 AM to Noon and Tue
    1:00 PM to 6:00 PM any feedback would be appreciated thanks much Storm


  • Pedro Graca

    #2
    Re: check certian time

    Stormkid wrote:[color=blue]
    > Hi Group, I'm trying to figure out a function that will check to make sure
    > the user has not double entered a certain time frame for example I don't
    > want them to be able to enter Mon 8:00 AM to 5:00 PM and Mon 9:00 AM to 1:00
    > PM but it is ok for them to enter something like Tue 8:00 AM to Noon and Tue
    > 1:00 PM to 6:00 PM any feedback would be appreciated thanks much Storm[/color]

    Use strtotime() function ( @ http://www.php.net/strtotime )
    to convert the string entered to a Unix timestamp

    [ "Mon 8:00 AM" ==> 1078171200 ]

    Then compare the values for overlapping.
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    Working...