''' <summary>
''' MessageBox.Show(saison("19/07/2008"))
''' </summary>
''' <param name="UneDate"></param>
''' <returns="season"</returns>
''' <remarks></remarks>
Function saison(ByVal UneDate As String) As String
Dim num As Int32 = 0
Dim z As Date
Dim season As String = String.Empty
Try
If Date.TryParse(UneDate, z) Then
num = z.DayOfYear
Select Case num
Case Is < 1
season = "error"
MsgBox(num)
Case Is < 81
If num > 0 Then
season = "hiver"
End If
Case Is < 173
If num > 80 Then
season = "printemps"
End If
Case Is < 265
If num > 172 Then
season = "été"
End If
Case Is < 356
If num > 264 Then
season = "automne"
End If
Case Is < 367
If num > 355 Then
season = "hiver"
End If
Case Else
season = "error"
End Select
Else
season = "error"
End If
Catch ex As Exception
Debug.Fail(ex.Message)
End Try
Return season
End Function