Solved

TIme Conversion

Posted on 2000-03-02
9
152 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
 
LVL 12

Expert Comment

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

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 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

10 Experts available now in Live!

Get 1:1 Help Now