Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hour(datetime()) Error !!!
Message
De
23/05/1999 09:56:59
 
 
À
23/05/1999 09:15:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00221882
Message ID:
00221884
Vues:
8
>Why VFP return the wrong hour when i use hour(datetime()) ?
>As i know , if i use hour(datetime()) to get the system time, the time format will in 24 hour !!!
>But that is an error when the system time is 12PM !!!
>It return 12 to me when i try to get the hour , actually the return value must be 24 !!!
>I don't know whne wrong with that ????
>Can anyone help me ?? Tell me what happen ???
>I need it to display the time in my project !!!!

RTFH. The HOUR() function ignores the setting of SET HOUR, and would return 0 at midnight, or 12 at noon. There is no time 24:00, there is a time 00:00; the range of times is 00:00 (midnight) - 23:59 (I left off seconds). Try the following:
tDateTimeTest = {^1999-01-01 24:00:00)  && errors out w/evaluated to an invalid value
tDateTimeTest = {^1999-01-01 00:00:00}  && midnight, January 1, 1999
? HOUR(tDateTimeTest)  && returns 0
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform