How to transmit Date and Time over can bus

I am attempting to find a smart way to transmit date and time over can bus. Any idea?

Use the number of seconds since a start point such as Linux or Windows does and then send this as the 8 bytes (ulong)

Or is that too easy? :whistle:

1 Like

Too easy ? yes :smiley:

I will try to see if I can use the ticks properties :dance:

The ticks property is a Long, so exactly 8 Byte.
You can simply send this over CAN.
The resolution of ticks is always identical in .NET.
But please be aware the the DateTime.MinValue (equals Zero ticks) is different for NETMF and Windows .NET.
This is true at least up to NETMF 4.3. I think I read that this is fixed in NETMF 4.4.
What I do is adding this difference to the NETMF 4.3 side value before sending it out (and the other way around when I receive one).

1 Like