TIme Conversion

hi all
i have this figure with me..
951453068
IT is the number of seconds elapsed from midnight Jan 1, 1970.
I want it to be conerted into current date..
Please help ASAP
Regards
Nitin
khacharnAsked:
Who is Participating?
 
rovermConnect With a Mentor Commented:
That's what my example does !
;-) RoverM
0
 
deightonprogCommented:
Dim x As Date
Dim i As Long

i = 951453068
x = DateAdd("s", i, DateSerial(1970, 1, 1))
MsgBox x
0
 
deightonprogCommented:
Private Sub Command1_Click()
Dim x As Date
Dim i As Long

i = 951453068
x = DateAdd("s", i, DateSerial(1970, 1, 1))
MsgBox x
MsgBox Format(x, "long date")
End Sub
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
rovermCommented:
MsgBox "Calculated date:" & Dateadd ("s", 951453068, cdate("01-01-1970"))


D'Mzzl!
RoverM
0
 
rovermCommented:
deighton: sorry had the question open while building the answer ;-)) !

0
 
khacharnAuthor Commented:
hi deighton's.
I will give you full points..
One small question:
How to convert the same to current time..
Please help ASAP
Regards
Nitin
0
 
khacharnAuthor Commented:
Sorry Delington..
I like roverm's answer better..
Regards
Nitin
0
 
khacharnAuthor Commented:
Thanx Roverm
Regards
Nitin
0
 
khacharnAuthor Commented:
Actually its my mistake..
roverm instead of cdate() the code should use DateSerial(1970, 1, 1))
Thanx Delington..
sorry i can't give you the points..
But it your code works just fine for me..
Thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.