GetDateTime()

Gets the set RTC time

C#

[DllImport("RGUSBdrv.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern UInt32 GetDateTime();

Returns:

Date time in UNIX Date time format

C# Example:

public static DateTime GetDateandTime()
        {
            uint uDateTime;
            uDateTime = GetDateTime();
            return DateTimeOffset.FromUnixTimeSeconds(uDateTime).DateTime;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (Connected)
                label1.Text = GetDateandTime().ToString();

        }

Last updated