Hi,
Thank you for your client of FSUIPC for dotnet programer :rolleyes:
I have started to use it and try to get Zulu Time like this :
private Offset<byte[]> fsLocalDateTime = new Offset<byte[]>(0x0238, 10);
private Offset<byte[]> fsZuluDateTime = new Offset<byte[]>(0x023B, 10); private Offset<byte> zmin = new Offset<byte>(0x23c); private Offset<byte> zhour = new Offset<byte>(0x23b); private Offset<byte> second = new Offset<byte>(0x23a);
private void timer1_Tick(object sender, EventArgs e) { // Process the default group try { FSUIPCConnection.Process();
// get local Time
short year = BitConverter.ToInt16(fsLocalDateTime.Value, 8); DateTime fsTime = new DateTime(year, 1, 1, fsLocalDateTime.Value[0], fsLocalDateTime.Value[1], fsLocalDateTime.Value[2]); short dayNo = BitConverter.ToInt16(fsLocalDateTime.Value, 6); fsTime = fsTime.Add(new TimeSpan(dayNo - 1, 0, 0, 0)); this.textBox1.Text = fsTime.ToString("dddd, MMMM dd yyyy hh:mm:ss");
// get Zulu Time year = BitConverter.ToInt16(fsZuluDateTime.Value, 8); DateTime fsZuluTime = new DateTime(year, 1, 1, fsZuluDateTime.Value[0], fsZuluDateTime.Value[1], fsZuluDateTime.Value[2]); short zuludayNo = BitConverter.ToInt16(fsZuluDateTime.Value, 6); fsZuluTime = fsTime.Add(new TimeSpan(dayNo - 1, 0, 0, 0)); this.textBox2.Text = fsTime.ToString("dddd, MMMM dd yyyy hh:mm:ss");
// or like this
year = BitConverter.ToInt16(fsZuluDateTime.Value, 8); DateTime fsZuluTimeBis = new DateTime(year, 1, 1, zhour.Value, zmin.Value, second.Value);
this.textBox3.Text = fsZuluTimeBis.ToString("dddd, MMMM dd yyyy hh:mm:ss");
}
}
but with this code the local time = zulu time even if my aircraft is on airport in GMT+8
Thank you for youyr help.
Motus