Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting the datetime to a time in the future
Message
De
23/05/2006 19:00:33
 
 
À
23/05/2006 06:05:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01124202
Message ID:
01124420
Vues:
11
>>NewDateTime = DateTimeField + (24*60*60)
>>? DATETIME(YEAR(NewDateTime), MONTH(NewDateTime), DAY(NewDateTime),9,0,0)
>>
>>** or
>>NewDateTime = TTOD(DateTimeField) + 1
>>? DATETIME(YEAR(NewDateTime), MONTH(NewDateTime), DAY(NewDateTime),9,0,0)
>>
>I was thinking in the same lines, but then an easier solution "hit me in the head". :-)
>?Datetime() -Seconds() + (33*60*60) && 33=24+9


Neither of the above work -- I tested by setting my clock to 2am and it gives me not the desired date time of today at 9:00 am. Seems to me there needs to be a test if after 9am in current date and then set based on that. If before 9:00am, then set to current date @9:00am; otherwise, advance one date and then set datetime.
IF TIME() > '09:00:00'
  ldDate = DATE() + 1
ELSE
  ldDate = DATE()
ENDIF
ldDateTime = DATETIME(YEAR(ldDate),MONTH(ldDate),DAY(ldDate),9,0,0)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform