0
我知道這個問題經常被問到,但是我找不到解決方案來解決我的問題。我的代碼是使用DateTime.ParseExact引發格式異常
Public Function ConvertFacebookDateToNETDate(Instant As String, Format As String) As Date
'Dim UTCOffset As New Integer
'UTCOffset = Instant.Substring(Instant.IndexOf("UTC+") + 4, 2)
Dim MyDateTime As DateTime
MyDateTime = New DateTime()
MyDateTime = DateTime.ParseExact(Instant, Format, CultureInfo.InvariantCulture)
'MyDateTime = MyDateTime.AddHours(-1 * UTCOffset)
Return MyDateTime
End Function
ConvertFacebookDateToNETDate("Friday, May 9, 2014 at 9:48am UTC+02", "dddd, MMMM d, yyyy at h:mtt UTCK")
這裏怎麼回事?
感謝