取消
顯示結果 
搜尋替代 
您的意思是: 

Decimal to Hex conversion


@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 


"Should be" isn't "Is" -Jay
0 積分
31 條訊息(共 39 條)
1,100 檢視

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.


"Should be" isn't "Is" -Jay
0 積分
32 條訊息(共 39 條)
1,090 檢視

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?

33 條訊息(共 39 條)
1,069 檢視

It is used to create file nomenclature and versioning actually.

0 積分
34 條訊息(共 39 條)
1,052 檢視

@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?

0 積分
35 條訊息(共 39 條)
1,042 檢視

@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. 😮

0 積分
36 條訊息(共 39 條)
1,040 檢視

@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).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
37 條訊息(共 39 條)
1,032 檢視

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.

0 積分
38 條訊息(共 39 條)
1,020 檢視

So why not use Number To Hexadecimal String and wire a 64 bit number to it? It is polymorphic, so it will work:

wiebeCARYA_0-1649145011620.png

 

Are there details in the SOP? "Time to Hex" can be interpreted in many, many ways.

0 積分
39 條訊息(共 39 條)
1,002 檢視