CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 TextBox should allow time of 24:00:00

Print topic Send  topic

Author Message
Hrqls

Posts: 3
Posted: 04/25/2008, 12:18 AM

hi,

this is my first post on this forum, so please gentle with me ;)

i inherited some php code from a former colleague
he generated that code in Code Charge Studio 2.3.2.24

the page contains some textboxes which contain starting and stopping times for certain actions

at the moment the maximum time in those textboxes is 23:59:59
i would like to change that to a maximum of 24:00:00

is that possible ?

the code which is used to create the textboxes is :
  
$this->START1 = new clsControl(ccsTextBox, "START1", "START1", ccsDate, Array("HH", ":", "nn", ":", "ss"));  
$this->STOP1 = new clsControl(ccsTextBox, "STOP1", "STOP1", ccsDate, Array("HH", ":", "nn", ":", "ss"));  
View profile  Send private message
ReneS

Posts: 225
Posted: 04/25/2008, 1:03 AM

Hi,

Don't know if that is possible, but, standard is that it gives a value of 00:00:00 after 23:59:59

So..

Rene
View profile  Send private message
Hrqls

Posts: 3
Posted: 04/25/2008, 1:43 AM

can the part that does this check be altered ?

there is some code which changes an input of 07:76:00 to 08:16:00
is the code which does this open source ?
can i change this ? ;)
View profile  Send private message
tonyk

Posts: 163
Posted: 04/25/2008, 7:12 AM

If you use a value of 24:00:00 you will be in deep water trying to do any time maths.
I would consider very carefully what was the benefit of having such a value. If it is to record the number of hours why not use seconds instead?
Quote Hrqls:
there is some code which changes an input of 07:76:00 to 08:16:00
is the code which does this open source ?
can i change this ? ;)

Are you trying to do something with time-zones? Are you measuring process intervals?

When asking questions here it really does help if you explain what it is you are trying to do. Experienced users may be able to advise you of simpler ways of achieving your aims. Quite frankly I have no idea what you are doing or why you should want a change such as that shown above in the quote.
However if you use seconds you will be able to manipulate the result into almost any format you wish to have. MySql has a time_to_sec function which can be very useful.
Tony

p.s. perhaps are you thinking of mktime, that is a crucial function for time manipulations? Look it up on the php website.
View profile  Send private message
Hrqls

Posts: 3
Posted: 04/29/2008, 11:50 AM

thanks for your reply

i am using a php page from a former colleague
on that page the user can enter 5 starting and 5 stopping times for a certain process
in between the starting and stopping times a dynamic road block should be active, outside these time periods the dynamic road block should be inactive (non blocking)
sor for example you can have the following periods (using 3 periods to make it shorter) :
  
start1   stop1    start2   stop2    start3   stop3  
06:00:00 10:00:00 16:00:00 19:00:00 00:00:00 00:00:00  
(this would be for a certain road which cant be used during high traffic times (to prevent main traffic going through villages to circumvent traffic jams)

or
  
start1   stop1    start2   stop2    start3   stop3  
00:00:00 06:00:00 10:00:00 16:00:00 19:00:00 23:59:59  
this would allow traffic using a specific road on busy times but will prevent much traffic when its not really needed

sometimes we want to have a road block to be active all day (00:00:00 - 24:00:00)
sometimes it should not be active at all on a single day (00:00:00 - 00:00:00)

each day has its own periods

now we had no problem at all with 00:00:00 - 23:59:59 where it was 'until and including 23:59:59' (less than or equal to stop#)
but recently we have 1 location which has to be inactive all day except on sunday between 00:00:00 and 04:00:00
the old code works fine except on the other days where it (very) shortly becomes active at 00:00:00
this is because it was active from 00:00:00 until (and including) 00:00:00
but this could lead to a problem between 23:59:59 and 00:00:00 of the following day

now we only check once a minute so (less than stop#) works fine as the seconds of 23:59:59 are using in the equation which is only checked once a minute .. but in the future we might want to check every second

i hope this made it more clear instead of more confusing ;)

(otherwise blame it on me being dutch and blond :))
now we changed the code to 'until (and not including)' (less than stop#)
View profile  Send private message
tonyk

Posts: 163
Posted: 05/01/2008, 6:38 AM

I think you may have to either include a flag to indicate the time of 00:00:00 or use full dates or play around with seconds and milliseconds!
Tony
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.