Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you add a month to datetime()
Message
De
20/07/2006 02:24:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01137516
Message ID:
01137932
Vues:
12
>>>How do you add a day or a month to a datetime? Do you have to convert things to seconds like below, or is there a better way?
>>>
>>>
>>>dt1 = datetime()
>>>* Add 2 months:
>>>nseconds = 2*31*24*60*60
>>>?dt1, dt1 + nseconds
>>>
>>>
>>>Cyril
>>
>>One solution:
>>lnMonth=1 && number of months
>>dt2=Datetime() + ((Gomonth(Date(),lnMonths)-Date())*24*60*60)
>
>Thanks for the pointer to Gomonth().
>Cyril

You're welcome.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform