Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time stored as seconds? 1

Status
Not open for further replies.

melaniecarr23

Programmer
May 2, 2005
79
US
I am again trying to use someone else's information and it's nuts! We have start and end times for appointments - some are 3 minutes some are 10. When I look in the database at an appointment with a start time of 450 and end time of 453 it makes me think the time is listed in minutes - but how do I convert this so it shows the actual clock time an appointment starts or ends?

I tried making it HH:MM but it didn't work. Tried dividing the start_time by 60 but that didn't work either.

Any help would be great! Thanks.
 

Hi,

Time values in MS Applications are in DAYS. TIME is part of DATE: the INTEGRAL part is the DATE part and the FRACTIONAL part is the TIME part.

So if your data is minutes, just convert minutes to days

Skip,
[sub]
[glasses] [red]Be advised:[/red]We know Newton's 3 Laws. But did you hear about the [red]FOURTH???[/red]
Only ONE fig per cookie![tongue][/sub]
 
A "Day" in MS speak is 1, and hour is 1/24; a minute is 1/(24 * 60) ... there are 86400 "Seconds" in a Day.

The Time values you provide look more like the minute of the day (1440 of those little buggers). So minute 450 would correspond to 450 1440 th's a day. This could (loosely) be stated as 0.3125 of a day or as 450 mod 1440 for 30 minutes and (by simple inspection) 7 hours (420 minutes) plus hte aforementioned 30 ones, circituously arriving at 7:30 AM.

Of course, there are numerous other paths / soloutions to the same, but all would be based on some assumption, mine just being somewhat obvious -at least to me.

Using the same assumption, one might easily just format the 0.3125 as time, LIKE UNTO:

? format(450 / 1440, "hh:mm")
07:30


Of course, using this will result in "military" time and "minute" values of 720 and greater will need to have the twelve Hours subtracted and the PM appended to make sense to many / most.



MichaelRed


 
Thank you MichaelRed!

I used:
Format(([start_time]/1440),"Long Time")

This gave me the times of the appointment in non-military time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top