- Option Explicit
-
- ' Variable pour la date.
- Private m_strDate As String * 10
- ' Variable pour l'année.
- Private m_strYear As String * 4
- ' Variable pour le mois.
- Private m_strMonth As String * 2
- ' Variable pour le jour.
- Private m_strDay As String * 2
-
- Public Property Get getDate() As String
-
- getDate = m_strDate
-
- End Property
-
- Public Property Get getYear() As String
-
- getYear = m_strYear
-
- End Property
-
- Public Property Get getMonth() As String
-
- getMonth = m_strMonth
-
- End Property
-
- Public Property Get getDay() As String
-
- getDay = m_strDay
-
- End Property
-
- Private Sub Class_Initialize()
-
- ' Obtenir la date courante.
- m_strDate = Date
- ' Prendre la partie année de la date.
- m_strYear = Left(m_strDate, 4)
- ' Prendre la partie mois de la date.
- m_strMonth = Mid(m_strDate, 6, 2)
- ' Prendre la partie jour de la date.
- m_strDay = Right(m_strDate, 2)
-
- End Sub
Option Explicit
' Variable pour la date.
Private m_strDate As String * 10
' Variable pour l'année.
Private m_strYear As String * 4
' Variable pour le mois.
Private m_strMonth As String * 2
' Variable pour le jour.
Private m_strDay As String * 2
Public Property Get getDate() As String
getDate = m_strDate
End Property
Public Property Get getYear() As String
getYear = m_strYear
End Property
Public Property Get getMonth() As String
getMonth = m_strMonth
End Property
Public Property Get getDay() As String
getDay = m_strDay
End Property
Private Sub Class_Initialize()
' Obtenir la date courante.
m_strDate = Date
' Prendre la partie année de la date.
m_strYear = Left(m_strDate, 4)
' Prendre la partie mois de la date.
m_strMonth = Mid(m_strDate, 6, 2)
' Prendre la partie jour de la date.
m_strDay = Right(m_strDate, 2)
End Sub