Solved

TIme Conversion

Posted on 2000-03-02
9
154 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:khacharn
  • 4
  • 3
  • 2
9 Comments
 
LVL 18

Expert Comment

by:deighton
ID: 2576015
Dim x As Date
Dim i As Long

i = 951453068
x = DateAdd("s", i, DateSerial(1970, 1, 1))
MsgBox x
0
 
LVL 18

Expert Comment

by:deighton
ID: 2576017
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
 
LVL 12

Expert Comment

by:roverm
ID: 2576025
MsgBox "Calculated date:" & Dateadd ("s", 951453068, cdate("01-01-1970"))


D'Mzzl!
RoverM
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 12

Expert Comment

by:roverm
ID: 2576029
deighton: sorry had the question open while building the answer ;-)) !

0
 

Author Comment

by:khacharn
ID: 2578991
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
 
LVL 12

Accepted Solution

by:
roverm earned 5 total points
ID: 2579136
That's what my example does !
;-) RoverM
0
 

Author Comment

by:khacharn
ID: 2582526
Sorry Delington..
I like roverm's answer better..
Regards
Nitin
0
 

Author Comment

by:khacharn
ID: 2582528
Thanx Roverm
Regards
Nitin
0
 

Author Comment

by:khacharn
ID: 2582553
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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now