Public Function GetTimeStamp(ByVal inputDate As DateTime) As Int32 Dim baseDate As New DateTime(1970, 1, 1, 0, 0, 0) If baseDate > inputDate Then Return 0 Return Convert.ToInt32((inputDate - baseDate).TotalSeconds) End Function
Return Convert.ToInt32(inputDate.Subtract(New DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime()).TotalSeconds)
Ciao.Sostanzialmente corretto però il tipo di dato TIMESTAMP, se non ricordo male, è riferito all'orario UTC quindi sarebbe opportuna la seguente conversione: Return Convert.ToInt32(inputDate.Subtract(New DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime()).TotalSeconds)
Torna al forum | Feed RSS