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:
01086353
Vues:
27
I think code takes care about midnigh already.

>That's similar to the idea I had in mind. But don't forget about midnigt. Also the requirement changed and I want the nearest 15 minutes rather than an hour.
>
>>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?
>>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform