ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
04-02-2022 03:35 PM
@altenbach wrote:
Easiest would be to just get minutes since Jan 1, 2000 and format in hex. 😄
Like timestamp mod 60?
Correcting a typo minute of day is up to 1500 and takes 11 bits but still cheaper than 8 for MM and 5 for HH
Unmanipulated YYMMDDHHMM fits
7+4+5+5+8 bits. using Julian date and some YY overflow manipulation yields 6+9+5+8 using the Quotient times Remainder of Julian mod 366 to extend YY to 204 so the y2.1k bug becomes y2.204k visitin the trouble caused here onto your 7th generation offspring. Minute of day goes to 6+9+11
04-02-2022 05:44 PM - edited 04-02-2022 05:47 PM
Aha, that 22 starts with a hex 5 or a sure sign YY uses 7 bits So, I'm fairly sure CA didn't use year in century+366+Julian+1500+minutes since midnight = compressed value and the inverse to stuff it all in 11bits with 79 values we could use to encode seconds, day of week, season and other parameters with.
04-04-2022 03:01 AM - edited 04-04-2022 03:09 AM
Wow, this took off over the weekend.
I love it when we get to make up our own problems 😁.
I made up more interesting problems for myself atm though.
Would be nice if OP finally shared a reason behind this question?
04-04-2022 10:08 AM
It is used to create file nomenclature and versioning actually.
04-04-2022 10:36 AM
@deep_217 wrote:
It is used to create file nomenclature and versioning actually.
That leaves so much to our imagination, it really raises more questions that it answers.
Why not simply store a date time string in the files?
04-04-2022 10:42 AM
@deep_217 wrote:
It is used to create file nomenclature and versioning actually.
As I already guessed.
You should be fine using U64, but you might as well just use the original string. More readable! Why add complications and hamper human readability?
Having a one minute resolution is however a questionable choice. Computers (and users) are often capable of creating more than one version in a minute. 😮
04-04-2022 10:54 AM
@deep_217 wrote:
It is used to create file nomenclature and versioning actually.
So why make it complicated? Just use the Date/Time string and be done. I personally use "%Y-%m-%d %H-%M-%S" as my time format. It adds breaks between the parts to make it more readable for my users (especially those Quality Engineers).
04-04-2022 02:12 PM
It is SOP from my predecessors and obviously my plan B was to use decimal string, but, it wont be an accurate answer to this problem so needed second opinion to see if a solution is available.
04-05-2022 02:50 AM
So why not use Number To Hexadecimal String and wire a 64 bit number to it? It is polymorphic, so it will work:
Are there details in the SOP? "Time to Hex" can be interpreted in many, many ways.