Solved

different time formats...

Posted on 1998-12-01
4
149 Views
Last Modified: 2010-05-03
There is some programs which expresses time in seconds counted somewhere from early 80´s.
Is this kind of way to express time familiar to someone and is there any function in VB5 so that those seconds can be transformed to normal date??

Thanks in advance!
0
Comment
Question by:majala
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 50 total points
ID: 1447596
Yes ther is!

DateAdd("s", lSeconds, "01-01-1980")

this adds the number of seconds hel in the long variable lSeconds to "1st Jan 1980" to give the date and time.
0
 

Author Comment

by:majala
ID: 1447597
How this could be done to other direction? If I have a "normal" date (e.x. 13.11.1998) and I wanna know how many seconds it is from 1.1.1980.
0
 

Author Comment

by:majala
ID: 1447598
How this could be done to other direction? If I have a "normal" date (e.x. 13.11.1998) and I wanna know how many seconds it is from 1.1.1980.
0
 
LVL 1

Expert Comment

by:lawnranger
ID: 1447599
Dim SD As Date
Dim ED As Date
Dim Seconds As Long
SD = "1/1/1980"
ED = "11/13/1998"
Seconds = DateDiff("s", SD, ED)

This will return the number of seconds between 0000 11/1/1980 and 0000 11/13/1980. You can also specify the time for either or both as in;

SD = "15:30 1/1/1980"
ED = Now

Hope this helps...
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

803 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