FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Verifying time in php
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Verifying time in php [message #179378 is a reply to message #179376] Sun, 14 October 2012 11:50 Go to previous messageGo to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
Denis McMahon wrote:
>> What is the easiest way to verify if what the people filled out is
>> correct? I have tried, but I get lost in the if statements.
>
> Verify it is correct in what way?
>
> If you want to record the time the data was entered, it would make more
> sense to use the system time, and not collect the data in the form at all.
>
> If you want the user to specify the time that an event happened in the
> past, or is to happen in the future, give them a select list with options
> of 1-31 for day, Jan-Dec for month, <whatever range suits> for year,
> 00-23 for hours, 00-59 for mins, 00-59 for seconds. Convert the form data
> to an actual timestamp and do whatever validation and verification you
> want.

Sorry for the confiusion. I hope the link I gave clariefied things a
bit. http://houghi/gopro.php
You can enter the number of hours, minutes and seconds yourself.
So it is to verify if the human entry is correct.
This is used for calcualtions.

Say that somebody would like to do a timelaps over a period of 8 hours
with an interval of 1 image every second and a framrate of 30. This
would result in a movie that is 16 minutes long.

The time can be almost anything. You could have a project that takes 10
days (240 hours) and with a 60 second interval that would be an 8 minute
movie.

So one can fill out hours, minutes and seconds. However if nothing is
filled out, it is not correct. At least one must be filled out.
Also it must be numbers and not nececerily limited to 59 minutes. If you
have a detail of 117 minutes, you should be able to do that and not
first calculate back to 1 hour and 57 minutes.
So dropdown is not an option (And I dislike dropdown options for
minutes)

So it is not so much time as it is duration.

I am able to test each if there is a numeric field. I can't get the
combination of the fields working:
1) One of the time fields must be filled out.
2) None of the time fields must contain non-digits.


houghi
--
Dr. Walter Gibbs: Won't that be grand? Computers and the programs
will start thinking and the people will stop.
-- Tron (1982)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Curl chmod file transfer problem...
Next Topic: test
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 19:26:57 GMT 2024

Total time taken to generate the page: 0.04277 seconds