|
Public Shared Function ToDateEOM(ByVal dt As Object) As DateTime
'//-- หาวันที่สิ้นเดือน EndOfMonth โดยใช้รูปแบบตาม culture ดังนี้
'//-- ถ้า CultureName en-US ต้องเป็น MM/dd/yyyy (ปีใช้คศ)
'//-- ถ้า CultureName en-GB ต้องเป็น dd/MM/yyyy (ปีใช้คศ)
'//-- ถ้า CultureName th-TH ต้องเป็น dd/MM/yyyy (ปีใช้พศ)
Dim tmpDate As DateTime
Try
tmpDate = System.DateTime.Parse(dt.ToString())
Return DateSerial(Year(tmpDate), Month(tmpDate) + 1, 1).AddDays(-1)
Catch
Return DateTime.MinValue
End Try
End Function
|
#1 By S L I P K N I K on 2009-07-18 19:57