Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timecalc.prg
Message
De
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:
00609920
Vues:
13
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

>Chris,
>
>The only problem in the above will be with hours or minutes less than 10. If you were to concatenate the hours and minutes without checking for that condition, you might end up with something like 8:9, which I don't think is what you're after. How's this?:
lnhours = SET("HOURS")
>SET HOURS TO 24
>* lnseconds is the difference returned by the subtraction
>* of one date/time from another
>* the date value shown below is of no consequence
>* and can be any date.
>lctime = TTOC(DATETIME(2002, 1, 24) + lnseconds, 2)
>* Restore the orginal setting of hours
>SET HOURS TO lnhours
In this example, this will return "10:35:00". If the seconds aren't needed simply take the first five character using the LEFT() function.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform