How do I retrieve the SERVER TIME

  • Thread starter Thread starter Kan D.
  • Start date Start date
Douglas,

after pasting all the code into a new module I ran the function:

Sub testIt()

msgbox fGetServerTime("\\SERVER-NAME")

End Sub


and it returned: 9/7/2006 -02:54:03 PM ?!?!

why would it return a minus time? The actual server time is 10:54:03 AM.

The Server is "Windows Server 2003"

The code comment said this function will only work with NT. So is that the
problem ("Windows Server 2003") ?


Thanks,
Kan
 
It looks like Dev didn't take proper time math into account when he was
subtracting the time zone difference. (For example, if you're in
Newfoundland and it's 15 minutes past the hour, it would come back with -45
minutes "past" the hour.) If you want to ignore time zone info, just remove
all references to intHoursDiff and intMinsDiff. If you do need to take it
into account, you'll have to do a bit better checking on it before you do
the math than what he's done.



Rob
 
thanks!

Robert Morley said:
It looks like Dev didn't take proper time math into account when he was
subtracting the time zone difference. (For example, if you're in
Newfoundland and it's 15 minutes past the hour, it would come back
with -45 minutes "past" the hour.) If you want to ignore time zone info,
just remove all references to intHoursDiff and intMinsDiff. If you do
need to take it into account, you'll have to do a bit better checking on
it before you do the math than what he's done.



Rob
 
Woops, I shoulda said -15 minutes past the hour in my example. Apparently
Dev's not the only one having problems with clock math. :P


Rob
 
Back
Top