Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timecalc.prg
Message
 
À
24/01/2002 13:34:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00609326
Message ID:
00609947
Vues:
9
>Hi George,
>
>I would like to thank you for your great help. I only have one more question and then I won't bother you anymore. :) In the expression
>
>lctime = TTOC(DATETIME(2002, 1, 24) + lnseconds, 2)
>
>Does it matter what parameters datetime() takes? I don't think it does (as long as its a valid date). I could just put in the year, month, and date the employee punched out at. The only problem with that is the nightshift. They'll punch in at something like Jan 24, 2002 at 2:30 PM and punch out on Jan 25, 2002 at 12:30 AM. However, I don't think it matters what datetime(lnyear, lnMonth, lnDay) is - because we are just looking for the hours worked.
>
>Thanks Again,

Chris,

You're quite welcome and it's not a bother.

All the expression above does is return hours, minutes, and seconds section as a string of the date/time value. It's important, to make sure that SET HOURS TO is 24, so that you get number of hours in the string. Otherwise, for 13 hours you'd get 01:00:00 PM. Since all you're interested in is the number of hours, by subtracting the two date/times you get the number of seconds difference, and the above simply is used to convert it to a string. Therefore, you're right in say that the date used is unimportant. I would, however, comment the line stating the purpose for it, so that if you come back later and can't remember exactly what's going on (a problem I suffer from), the comments will explain to you, or in the event someone else is working with it, they'll know as well.

Thanks for the kind words,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform