Convert the time to seconds, and it’s OK to change the seconds to binary. As for - whether you can use the binary format according to the coding table or other methods, it’s up to you
Isn’t the half-hour unit dividing 1 day into 48 segments? 0-47 means that the segment number corresponds to each period of time. The i-th string of string corresponds to the segment number i. 0 means that it is during this time. 1 means that it is not during this time. The specific program is not difficult to write. Just ask for the segment number and replace the string content. The segment number is to convert the time into hours and then divide it by 0.5 to round up.
Written a js version for the console
Time is used
[[0,30],[11,0]]
表示00:30 - 11:00
, so the second situation is like thisThe following is the decoding
Convert the time to seconds, and it’s OK to change the seconds to binary. As for - whether you can use the binary format according to the coding table or other methods, it’s up to you
Isn’t the half-hour unit dividing 1 day into 48 segments? 0-47 means that the segment number corresponds to each period of time.
The i-th string of string corresponds to the segment number i. 0 means that it is during this time. 1 means that it is not during this time.
The specific program is not difficult to write.
Just ask for the segment number and replace the string content.
The segment number is to convert the time into hours and then divide it by 0.5 to round up.