Solved

different time formats...

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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 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…
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…

762 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

23 Experts available now in Live!

Get 1:1 Help Now