?
Solved

TIme Conversion

Posted on 2000-03-02
9
Medium Priority
?
163 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 15 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

807 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