MS Access Forum / Forms / March 2007
Show Times around World
|
|
Thread rating:  |
franklinbukoski - 05 Mar 2007 17:14 GMT I'd like to show multiple times in the database but can not figure out how to do this.
I've tried =(Time()+8) Looked through the help menu and searched this discussion group without success.
Mr B - 05 Mar 2007 17:52 GMT franklinbukoski,
If you add the line below as the control source for a text box on your form, it will produce the current time at your location (based on the current date and time in your computer).
=Format(Now(),"h:n AM/PM")
If you add the line below as the control source for a text box on your form, it will produce the current time where the time is one hour ahead of your location:
=Format(DateAdd("h",1,Now()),"h:n AM/PM")
If you add the line below as the control source for a text box on your form, it will produce the current time where the time is two hours behind you:
=Format(DateAdd("h",-2,Now()),"h:n AM/PM")
Take a look in the help file for more information on using the "DateAdd" function.
 Signature HTH
Mr B
> I'd like to show multiple times in the database but can not figure out how to > do this. > > I've tried =(Time()+8) > Looked through the help menu and searched this discussion group without > success. Al Campagna - 05 Mar 2007 17:57 GMT franklin, You might also want to know what Date it is, as well as time. Given that Now() is the current Date&Time... and you're in New York. Chicago Time = DateAdd("h", -1,Now()) Los Angeles = DateAdd("h", -3, Now()) If you dont want the date, just format the calculation result for Time.
 Signature hth Al Campagna . Candia Computer Consulting . Candia, NH USA Microsoft Access MVP http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
> I'd like to show multiple times in the database but can not figure out how to > do this. > > I've tried =(Time()+8) > Looked through the help menu and searched this discussion group without > success. franklinbukoski - 05 Mar 2007 18:43 GMT Thank both of you very much!
> franklin, > You might also want to know what Date it is, as well as time. [quoted text clipped - 8 lines] > > Looked through the help menu and searched this discussion group without > > success. Mr B - 05 Mar 2007 21:52 GMT You are very welcome. Glad to help.
Mr B
> Thank both of you very much! > [quoted text clipped - 10 lines] > > > Looked through the help menu and searched this discussion group without > > > success. franklinbukoski - 06 Mar 2007 16:18 GMT I've got all of the times working. I thought it would automatically be a running clock but the times are stagnant, from when I first opened the form.
I have 6 different world times I'd like to show on the startup page. This page remains open while users navigate to different pages and return to the startup periodically.
Is there a way to get all of the clocks to run simultaneously, realtime?
> You are very welcome. Glad to help. > [quoted text clipped - 14 lines] > > > > Looked through the help menu and searched this discussion group without > > > > success. Douglas J. Steele - 06 Mar 2007 16:36 GMT See http://www.mvps.org/access/forms/frm0032.htm at "The Access Web"
You'll need to repeat each of the clocks in the Form_Timer sub.
 Signature Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!)
> I've got all of the times working. I thought it would automatically be a > running clock but the times are stagnant, from when I first opened the [quoted text clipped - 29 lines] >> > > > without >> > > > success. franklinbukoski - 06 Mar 2007 16:36 GMT As I continue to work on this, I think all I need to do to get it working is to figure out how to manipulate the following: = Format(Now, "hh:nn") to add and subtract hours.
> You are very welcome. Glad to help. > [quoted text clipped - 14 lines] > > > > Looked through the help menu and searched this discussion group without > > > > success. Mr B - 06 Mar 2007 17:01 GMT As Doug as indicated, if you want the times to be continually updated then you would need to put code in the timer event of the form that would cause each of your times to be updated at a specific interval.
In the examples that I provided for displaying the various times, each time is independent and not dependent on the other time.
You really should take a look at the code example that Doug provided for use in the timer event of your form. This will work to keep all times continually update.
 Signature HTH
Mr B
> As I continue to work on this, I think all I need to do to get it working is > to figure out how to manipulate the following: [quoted text clipped - 19 lines] > > > > > Looked through the help menu and searched this discussion group without > > > > > success. Douglas J. Steele - 06 Mar 2007 17:09 GMT You add and subtract the hours, then format. The Format function converts whatever's passed to it to Text, so you cannot do arithmetic with it.
Format(DateAdd("h", -1, Now()), "hh\:nn")
 Signature Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!)
> As I continue to work on this, I think all I need to do to get it working > is [quoted text clipped - 24 lines] >> > > > without >> > > > success. franklinbukoski - 06 Mar 2007 17:24 GMT The article was very beneficial. I input the following with one last problem: Private Sub Form_Timer() Me!Eastern.Caption = Format(Now, "dd mmm / hh:nn") Me!Central.Caption = Format(DateAdd("h", -1, Now()), "dd mmm / hh:nn") Me!Pacific.Caption = Format(DateAdd("h", -3, Now()), "dd mmm / hh:nn") Me!Berlin.Caption = Format(DateAdd("h", 6, Now()), "dd mmm / hh:nn") Me!Tokyo.Caption = Format(DateAdd("h", 14, Now()), "dd mmm / hh:nn") Me!Baghdad.Caption = Format(DateAdd("h", 8, Now()), "dd mmm / hh:nn") Me!Afghanistan.Caption = Format(DateAdd("h", 9.5, Now()), "dd mmm / hh:nn") End Sub
The problem being the code does not recognize 9.5, or 9 1/2, or 9:30. Where time in Kabul, Afghanistan is 9.5 hours ahead of my time (eastern standard time, US)
> You add and subtract the hours, then format. The Format function converts > whatever's passed to it to Text, so you cannot do arithmetic with it. [quoted text clipped - 29 lines] > >> > > > without > >> > > > success. Mr B - 06 Mar 2007 17:44 GMT Your on your own with the half hour thing. I did not know that there was any situation where there was a half hour difference in time. I thought all time zones were in one hour imcrements.
I'll be interested in the out come. Please post back with the answer.
Mr B
> The article was very beneficial. I input the following with one last problem: > Private Sub Form_Timer() [quoted text clipped - 45 lines] > > >> > > > without > > >> > > > success. franklinbukoski - 06 Mar 2007 18:05 GMT Mr. B.
To get the correct time, I changed adding an increment of hours to minutes.
Me!Afghanistan.Caption = Format(DateAdd("n", 570, Now()), "dd mmm / hh:nn")
I wouldn't have been able to deduct this without all of the wonderful support of this ddiscussion group!
> Your on your own with the half hour thing. I did not know that there was any > situation where there was a half hour difference in time. I thought all time [quoted text clipped - 53 lines] > > > >> > > > without > > > >> > > > success. Douglas J. Steele - 06 Mar 2007 18:00 GMT Add 570 minutes:
Me!Afghanistan.Caption = Format(DateAdd("n", 570, Now()), "dd mmm / hh:nn")
 Signature Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!)
> The article was very beneficial. I input the following with one last > problem: [quoted text clipped - 50 lines] >> >> > > > without >> >> > > > success. franklinbukoski - 06 Mar 2007 18:09 GMT Yes sir! In fiddling with the code I came to the same conclusion. Thank you very much for posting to my question!
> Add 570 minutes: > [quoted text clipped - 54 lines] > >> >> > > > without > >> >> > > > success.
|
|
|