Conversion Date

rems02 Messages postés 101 Date d'inscription vendredi 4 avril 2003 Statut Membre Dernière intervention 21 janvier 2008 - 10 déc. 2004 à 14:52
jrivet Messages postés 7392 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 6 avril 2012 - 10 déc. 2004 à 15:53
Comment convertir un nombre de jours (ex: 109174)
en x ans, x mois, x jours ?
Il existe une fonction VB ou il faut créer une ?

Rem'S 8-)

2 réponses

Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
10 déc. 2004 à 15:18
Dim dt As Long
dt = 109174

'transformation en date
MsgBox Format$(dt, "dd/mm/yyyy")

'en jours, mois, années
Dim s As String
s = Format$(dt, "dd/mm/yyyy")
MsgBox " jour=" & Left$(s, 2)
MsgBox " mois=" & Mid$(s, 4, 2)
MsgBox "année=" & Right$(s, 4)

Daniel
0
jrivet Messages postés 7392 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 6 avril 2012 60
10 déc. 2004 à 15:53
Salut,

OU alors pour
jour mois annee:

Dim s As date
s = CDATE("12/11/2004")
MsgBox " jour=" & day(s)
MsgBox " mois=" & Month(s)
MsgBox "année=" & Year(s)

Question: ce numero de jour c est le numero de jour depuis Quand?

@+
Julien
-----------------------------------------------------------
:big) Essaie ca sinon on trouvera autre chose ;)
-----------------------------------------------------------
0
Rejoignez-nous