السلام عليكم ورحمة الله وبركاته
وجدت الحل
Date to unixdate
UnixDate to date
وهذه كما اضافها الاخ Done بارك الله فيه وفي جميع الاخوة
وجدت الحل
Date to unixdate
PHP كود :
Public Function ToTimeStamp(ByVal target As DateTime) As Integer
Dim [date] As New DateTime(1970, 1, 1, 0, 0, 0, target.Kind)
Dim hubspotTimestamp As Integer = System.Convert.ToInt64((target - [date]).TotalSeconds)
Return hubspotTimestamp '* 1000
End Function
PHP كود :
Public Function UnixToDateTime(ByVal strUnixTime As String) As DateTime
Dim nTimestamp As Double = strUnixTime
Dim nDateTime As System.DateTime = New System.DateTime(1970, 1, 1, 0, 0, 0, 0)
nDateTime = nDateTime.AddSeconds(nTimestamp)
Return nDateTime
End Function
كود :
Private Function TimeToNumber(ByVal dt As DateTime) As Long
Return dt.Subtract(New Date(1970, 1, 1)).Ticks
End Function
Private Function LongToTime(ByVal L As Long) As DateTime
Return New Date(L).AddTicks(New Date(1970, 1, 1).Ticks)
End Function