-
Something like gmtime() or localtime() in C
-
UTC to Date
Am I missing something or is that just a matter of taking the UTC value and adding this to January 1, 1970.
Thats what UTC is meant to be anyhow. i.e. 00:00:01 UTC = 1 second after midnight on 1 Jan 1970.
Do you need more help or is that enough of a clue for now ;)
Regards
Paul Lewis
-
just in case
Here is a sample piece of code to go from UTC to date.
Form1 has Command1 button and Text1 and Text2 textboxes.
type the UTC value in Text1 and hit the button.
Code:
Option Explicit
Private Function UTCtoDate(utc As Double) as Date
Dim utc0 As Date
Dim mydate As Date
utc0 = DateSerial(1970, 1, 1)
' 86400 = seconds in a day
mydate = CDate(utc / 86400#) + utc0
UTCtoDate = mydate
End Function
Private Sub Command1_Click()
Text2.Text = UTCtoDate(CDbl(Text1.Text))
End Sub
-