Solved

different time formats...

Posted on 1998-12-01
4
148 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now