This is an epoch problem. (Hopefully you will catch the humor in that)
Opto has a command to give you an NTP timestamp - the UUID version 1 algorithm has its own kind of timestamp (UUID timestamp).
NTP timestamp is a 64 bit value - top 32 bits are seconds since 01 January 1900 (called the NTP epoch) and the lower 32 bits are in fractional seconds (they will run through the entire 32 bit number space every second - yikes).
UUID timestamps are 100ns intervals since 15 October 1582 (UUID epoch and the start of the Gregorian calendar) stored in 60 bits.
So with a bit of bit shufflin’ you can convert from one to the other:
GetDateTime(ntDateTime); //Current controller time (local time)
DateTimeToNtpTimestamp(ntDateTime, n64NTP); // 1/(2^32) seconds since 1/1/1900 (NTP epoch)
n64TimeZoneOffset = GetTimeZoneOffset(0); //time zone offset in seconds
n64TimeZoneOffset = -25200; //Using softpac, so I'm adjusting manually for this test - remove before flight
n64TimeZoneOffset = n64TimeZoneOffset << 32; //Shift over to NTP sized timestamp
n64NTP = n64NTP - n64TimeZoneOffset; //NTP timestamp in UTC (This is what an SNTP server should give you)
//Convert from NTP timestamp to UUID timestamp
//First get from the NTP fractional seconds to 100ns intervals, then we can adjust for the epoch difference
//Separate top 32 from bottom 32
//n64Top = GetHighBitsOfInt64(n64NTP); //This extends the sign bit, poo!
n64Top = (n64NTP bitand 0xFFFFFFFF00000000i64) >> 32; //Do it this way
//n64Top is in seconds, we need to get them into 100ns intervals now
n64Top = n64Top * 10000000i64;
//n64Bottom = GetLowBitsOfInt64(n64NTP); //this will cause issues with the sign bit too
n64Bottom = n64NTP bitand 0x00000000FFFFFFFFi64;
//n64 is in fractional seconds, convert to 100ns (n64Bottom * 10^7)/2^32
n64Bottom = (n64Bottom * 1000000i64) / 0x100000000i64;
//Add the two 100ns values together
n64NTP100ns = n64Top + n64Bottom;
//Adjust from NTP epoch (1/1/1900) to UUID epoch (10/15/1582)
//(115,860 days = 10,010,304,000 seconds = 100103040000000000 * 10^-7 seconds)
n64UUIDTimestamp = n64NTP100ns + 100103040000000000i64;
//Add the timestamp RFC 4122 version 1 to the top 4 bits
n64UUIDTimestamp = (0x0FFFFFFFFFFFFFFFi64 bitand n64UUIDTimestamp) + 0x1000000000000000i64;
From there you can convert the n64UUIDTimestamp to a hex string and tear it apart to build the top 64 bits of the UUID.
You will need to store a copy of this timestamp in persistant storage along with a clock sequence number that is initially generated randomly. The next timestamp you generate, if it is less than (or equal in my opinion) than the one stored, then you need to increment the clock sequence #. This is to ensure uniqueness after a clock change. The clock sequence is part of the UUID as well along with the ethernet MAC address which you already retrieved. This is all documented in the RFC.