Link to home
Start Free TrialLog in
Avatar of heit
heit

asked on

TIME$ in seconds-after-"01/01/1970" format

is there a standard function to convert time$ into the 'seconds-after-1970'-format? this would be a lot easier and quicker for my database application which has to search on date/time very, very often

i know in unix this format is standard, but i haven;t seen it in vb yet.

It isn;t hard to program, but it seems kinda slow .. besides, i don;t know all the exceptions (which year had one day to many etc)
Avatar of mark2150
mark2150

Internally date/time is a double. Date is integer part, time is decimal. This makes date comparisions about as fast as you're going to get them.

M
ASKER CERTIFIED SOLUTION
Avatar of deighton
deighton
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or

(Now - 25569#) * 86400
Right, but since time is already a *number* internally scaling up or down won't make the comparision operations any faster.

A Date is only a date when *displayed*. The internal comparisions are already in numeric. heit's idea for speeding things up will actually be SLOWER as the database is already doing what he wants internally.

If date/time were internally stored as character string he'd have a point. But since is *already* a number scaling won't run any faster and time lost in performing scale is wasted...

M
Avatar of heit

ASKER

deighton, thanx!

mark2150> ok, i didn't tell te whole story .... i have to make a lot of queries which load all data not older than 30 minutes .. i think doing it in integers is easier, also because now it is a lot easier for me to know which is 30-minutes-ago exactly. I see your point however ... thanx anyway!