Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy way to convert datetime() to the nearest hour?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01086260
Message ID:
01086355
Vues:
35
Again not tested much
? DATETIME(YEAR(ltDt), MONTH(ltDt), DAY(ltDt), HOUR(ltDt), 0, 0) + ;
	CEILING((MINUTE(ltDT)*60 + SEC(ltDT))/(15*60)) * 15*60
>>Not tested
ltDt = DATETIME()
>>? DATETIME(YEAR(ltDt), MONTH(ltDt), DAY(ltDt), HOUR(ltDt), 0, 0) + ;
>>	IIF(MINUTE(ltDT)*60 + SEC(ltDT) >= 30*60, 1*60*60, 0)
>>
>>>
>>>How can I convert datetime() to the nearest hour?
>>>
> I also didn't specify the problem correctly. I always want to schedule for the future.
>
>I believe your code does what I want after I'd make minor adjustments.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform