Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Midnight time
Message
De
10/02/2020 13:20:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01672998
Message ID:
01673009
Vues:
54
>>>>>>>Why do you think she would not allow the entry of 24:00?
>>>>>>
>>>>>>I think by 'normal' clock time the next time after 23:59 is 00:00. 24:00 is same as 00:00. There is not a time of 24:01 -- it would be confusing to see 24:00 and then 00:01 when the seconds ticked by... Time goes from 00:00 to 23:59 each day.
>>>>>
>>>>>My problem is that, since I ignore seconds, the minute between 23:59:00 and 23:59:59 is "not accounted" for. The data set by VFP is used by the .NET application: compares the current time with the time set by VFP. So, the .NET application could be reading the current time as 23:59:30 and the logic will tell the problem that this is outside of the day hours/minutes (00:00 to 23:59). But as I type this, I am thinking of the following "solution" When converting the time set by VFP (e.g. 23:59) in the .NET application, I could add the seconds part of 59 (automatically). Therefore, the entire range of time will be accounted.
>>>>>Thank you.
>>>>
>>>>Of course the next question you may need to ask -- to what day does midnight belong? The 00:00:00 notation would suggest that midnight is the beginning of a day, whereas the 24:00:00 notation would suggest it is the end of a day.
>>>
>>>No, this question would not come up since I decided NOT to use the 24:00:00 but rather 23:59:59.
>>
>>In doing so, you've also avoided related "can of worms":
>>* where does noon belong? is it the end of the first half of the day, or beginning of the latter half?
>>* question of the beginning of a time period and the end -- 24:00:00 notation would suggest that first hour of the day would be 00:00:01 to 01:00:00 inclusive.
>
>Another question would be "Why does your day have 25 hours?" as that is the number of hours from 0 to 24 :)

And of course, there is at least one situation where ability to use "24:00" to specify midnight (in addition to "00:00") might end up being necessary. For example if you're specifying time range -- for example in an access control profile where you're specifying the times at which access should be granted. Let's say the entry fields specify the beginning and ending time in which access should be granted. In this case we might consider an entry of:
00:00 ` 00:00
to mean "no access", and something like:
09:00 ` 17:00
means allow access between 9am to 5pm.
The question is, how to represent 24-hour access?
We could try to "be clever" and say that the end range actually specifies the ending of the time period starting with the specified time (i.e. 17:00 actually means times between 17:00:00 thru just before 18:00:00). But this of course has the "side effect" of changing the meaning of:
00:00 ` 00:00
to now mean the "first minute of the day" rather than the "no access" meaning we originally intended. Of course, one might think that "reverse" time sequence to indicate "no access" (e.g. something like "02:00" to "01:00" could be used to mean "no access" situation). But now there's another problem -- how do specify time segments that "straddle" day boundary (e.g. 11pm to 6am of next day) ? You could allow for that if you allow end time to appear to be "before" the start time (e.g. "22:00 - 06:00"), though for the sake of simplicity it might be advisable to avoid that, and provide at least two time segments to allow for this. This simplifies the checking for grant/deny condition, as you won't have check for the previous day's time range in that case -- the checking could be limited only for the current day.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform