?
Solved

different time formats...

Posted on 1998-12-01
4
Medium Priority
?
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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 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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

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