void getTime(IntPtr sdkContext, UInt32 deviceID, bool isMasterDevice) { UInt32 timestamp = 0; Console.WriteLine("Trying to get device time"); BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetDeviceTime(sdkContext, deviceID, out timestamp); if (result != BS2ErrorCode.BS_SDK_SUCCESS) { Console.WriteLine("Got error({0}).", result); } else { DateTime currentTime = Util.ConvertFromUnixTimestamp(timestamp); Console.WriteLine(">>>> Device time : " + currentTime.ToString("yyyy-MM-dd HH:mm:ss")); } }