I assume the format is "AAyymm", where A is the uppercase character yy is a two-digit year and mm is a two-digit month.
Therefore, you can match it with bits 10 (AA) + Y (yy) + 4 (mm). where Y = 32 - 10 - 4 = 18 bits for a 32-bit representation (or 262144 years). With this, you can represent the format as an integer by moving the characters there and moving the year and month pairs there, after converting them to an integer.
Note: there will always be spaces in the binary representation. Here is a 5 + 5 bit representation for characters (values ββ6 + 6) and in a 4-bit month representation (4 values)
To avoid spaces, change the view to ABmmmm, whether the AB pairs were represented by 26 * A + B, and mmmm is the month relative to some zero month for some year (which spans 2 ^ 32/1024 / 12 = 349525 years - with 32 bits )
However, you may consider splitting characters and time. Combining two values ββin one field is usually difficult (it may be a good storage format, but not a good "program data format").
source share