Date-time coding

  • Thread starter Thread starter Eric G
  • Start date Start date
E

Eric G

Our server time is slipping badly but our tech maintenance guy has
chosen not to fix the clock on the server at this time. As a result,
all of our computer clocks are off by about 10 hrs now.

We have a report that needs to be printed each day that has a couple
of date-time fields.

At the top of the report is a field with the formula =Now() with
format Long Date showing today's date.
At the bottom is a field with the formula =Now() with format Medium
time, showing the current time.

Of the two, the top date is the more critical at this time, as it is
just about an hour away from telling the wrong date whenever the
report is printed.

How can I change the two formulas so that about 10 hrs. are _added to
them?

TIA Eric
 
=Now() + (10/24)

or

=DateAdd("h", 10, Now())

Of course, the obvious answer is to fix the clock (!), as you'll just keep
needing to change this expression over and over! Good luck.
 
Get a large stick and threaten your tech maintenance guy. Well, a guess
violence is not really a good way to solve the problem.

You can use the DateAdd function to do this, but you will have to remember to
remove it again when the tech guy fixes the server time.

When you have = Now() put
DateAdd("h",10,Now())

Also, if you have any fields in your tables that you are populating with Date()
or Now() you are going to have to adjust them and then remove the adjustment
later. So if you can I would suggest you find a way to bribe or persuade the
tech guy to do his/her/its job.
 
to add 10 hours, change the formula in each field to
=DateAdd("h",10,Now())

if you wanted to subtract 10 hours, the formula would be
=DateAdd("h",-10,Now())

if you look up DateAdd in the Access Visual Basic Help,
it'll tell you all about this very handy function. :)

hth
 
Hi Ken,

Thanks very much for your help!
I will be going after the tech guy once again, the next time I see
him. Too bad he doesn't work for me :) Eric
 
Hi John,

Thanks for your help.
And thanks for reminding me about the date fields in my tables.
I work at a school as a teacher, and this tech guy works for the
school board so he doesn't answer directly to me.

When I asked him to make the change the other day (it's been like this
for several months now) he mentioned something about having to shut
down the server etc. etc. In other words, he had other things to do,
as usual, and he didn't think it was very important.

I'll bug him again the next time I see him. Eric
 
an IT admin who thinks that having the server clock off by
10 hours isn't important??? i wonder what else he doesn't
 
Back
Top