Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using NetRemoteTOD

Posted on 1998-11-19
1
Medium Priority
?
618 Views
Last Modified: 2012-08-14
I have been trying to get NetRemoteTOD working in VB. There was a question about it here before but I still can't seem to get it to work. I'm using VB5. I get a large number out for "elapsed" but nothing else. Everything else is zeros.  Any ideas?



Type TIME_OF_DAY_INFO
  tod_elapsedt As Long  '/* time from 1-1-1970 in seconds */
  tod_msecs As Long     '/* milliseconds */
  tod_hours As Long     '/* hours */
  tod_mins As Long      '/* minutes */
  tod_secs As Long      '/* seconds */
  tod_hunds As Long     '/* hundredths */
  tod_timezone As Long  '/* time zone in minutes from GMT */
  tod_tinterval As Long '/* timer interval (units = 0.0001 sec) */
  tod_day As Long       '/* day */
  tod_month As Long     '/* month */
  tod_year As Long      '/* year */
  tod_weekday As Long   '/* day of week */
End Type

Declare Function NetRemoteTOD Lib "NETAPI32.DLL" (ByVal pszServer As String _
                     , pbBuffer As TIME_OF_DAY_INFO) As Long
Sub Main()
Dim tTime As TIME_OF_DAY_INFO
Dim lLength As Long
Dim lReturn As Long
Dim swServername As String

lLength = Len(tTime)
sServername = ""
lReturn = NetRemoteTOD(sServername, tTime)

Debug.Print "lReturn=" & lReturn
Debug.Print "Elapsed    = " & tTime.tod_elapsedt
Debug.Print "Milliseconds= " & tTime.tod_msecs
Debug.Print "Hours     = " & tTime.tod_hours
Debug.Print "Minutes   = " & tTime.tod_mins
Debug.Print "Seconds   = " & tTime.tod_secs
Debug.Print "Hundreds  = " & tTime.tod_hunds
Debug.Print "Time Zone = " & tTime.tod_timezone
Debug.Print "Time Interval = " & tTime.tod_tinterval
Debug.Print "Day     = " & tTime.tod_day
Debug.Print "Month   = " & tTime.tod_month
Debug.Print "Year    = " & tTime.tod_year
Debug.Print "Weekday = " & tTime.tod_weekday
End Sub
0
Comment
Question by:buckingd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
jf26028 earned 200 total points
ID: 1445791
This may not be what you are looking for, but if you go to
http://www.swt.edu/~jf26028/time.zip

it has an application to check the time on a remote server on the internet and post it to your machine.  With a little tweak, it could be used to set the local time on your computer to the remote time.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question