Information générale
Catégorie:
Codage, syntaxe et commandes
Thanks Robert.
How do you use or configure a DateTime field so the user only has the time to enter and no date?
Raymond
>Hello Raymond,
>
>Datetime will force users to enter a valid date & time without much checking on your part, as long as the users don't balk at the default input structure. You can also peform math calculation fairly easily.
>
>If you use a text field HH:MM you need to check the range for hours and minutes, and generally you would convert to a decimal version to do the math.
>
>EX: 12:30 = 12.50 (divide minutes by 60) and you also have to account for time that breaks over a boundry:
>
>02:00 - 10:00 = 4.00 (add 12 to the hours if it rolls over)
>
>I've done it both ways, easier with datetime, users liked entering the text method better, but only because of the code enforcing the input was more flexible because it was custom.
>
>Bob
>
>>What is the best way to do calculations with time?
>>
>>I have a time sheet to do where the users enter the time started such as 8:30 and the end time such as 13:20.
>>Should I use a character field for entry formated 99:99 or is a datetime better?
>>Are there pre existing functions to do the calculations?
>>
>>Thanks in advance.
>>
>>Raymond Larche
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement