eric_krum
asked on
How do you convert an epoch time to a standard Date/Time (m/d/y hh:mm:ss) format?
I am in the process of writing a parsing utility that will take the data from our AVL system and populate it into an SQL database. However, the one hang up that I am running into is that it stores the date and time in an epoch date format. I have read this posting:
https://www.experts-exchange.com/questions/22100727/Convert-date-time-to-Unix-Epoch-time.html
but I need it to go the other way.
How would I accomplish this?
Any help would be appreciated. Thanks.
https://www.experts-exchange.com/questions/22100727/Convert-date-time-to-Unix-Epoch-time.html
but I need it to go the other way.
How would I accomplish this?
Any help would be appreciated. Thanks.
and to format
MsgBox("Windows Time: " + dtr.ToString("M/d/y hh:mm:ss", (New Globalization.CultureInfo( "en-US")). DateTimeFo rmat))
MsgBox("Windows Time: " + dtr.ToString("M/d/y hh:mm:ss", (New Globalization.CultureInfo(
ASKER
I have taken the code that you supplied and modified it as follows:
Dim dtEpoch As Date
Dim dtr As Date = dtEpoch.AddSeconds(1195369 198)
MsgBox("Windows Time: " + dtr.ToString)
MsgBox("Windows Time: " + dtr.ToString("M/d/y hh:mm:ss", (New Globalization.CultureInfo( "en-US")). DateTimeFo rmat))
However, the output has the correct M/D but the year and the time are off. Am I missing something?
Dim dtEpoch As Date
Dim dtr As Date = dtEpoch.AddSeconds(1195369
MsgBox("Windows Time: " + dtr.ToString)
MsgBox("Windows Time: " + dtr.ToString("M/d/y hh:mm:ss", (New Globalization.CultureInfo(
However, the output has the correct M/D but the year and the time are off. Am I missing something?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
MsgBox("Windows Time: " + dtDate.ToString)