avatar
c*t
2
MM - 0-9AB
DD - 0-9A-U
YY - chr(33) - chr(133)?

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
avatar
D*g
3
没明白

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
avatar
c*t
4
It's easy to use one character to reprent either month or day; The maximun
one
is 31. (we have 0-9A-Z total 36 to use); but for year, assuming using two
digits, there are 100 possibilities, may use ascii to reprent....
Is there better idea to encode a date?

【在 D****g 的大作中提到】
: 没明白
avatar
t*t
5
要只用0-9A-Z也不是不可以,不过就要做一点运算而已
100*12*31=37200 < 46656=36*36*36

【在 c**t 的大作中提到】
: It's easy to use one character to reprent either month or day; The maximun
: one
: is 31. (we have 0-9A-Z total 36 to use); but for year, assuming using two
: digits, there are 100 possibilities, may use ascii to reprent....
: Is there better idea to encode a date?

avatar
c*t
6
gotta, 36 进制! 我也是才想到这一点

【在 t****t 的大作中提到】
: 要只用0-9A-Z也不是不可以,不过就要做一点运算而已
: 100*12*31=37200 < 46656=36*36*36

avatar
c*t
7
这样三位可以cover 127 年

【在 c**t 的大作中提到】
: gotta, 36 进制! 我也是才想到这一点
avatar
t*t
8
那你干嘛不用0-9A-Za-z,就可以cover 640年了

【在 c**t 的大作中提到】
: 这样三位可以cover 127 年
avatar
c*t
9
the tag requires upper case & digits only

【在 t****t 的大作中提到】
: 那你干嘛不用0-9A-Za-z,就可以cover 640年了
avatar
O*d
10
Using first 4 bits of the first char to represent month 1 - 12. The last 4
bits to represent day 1-16. Using one bit in the second char to represent a
flag which indicates whether to add 15 to the day. You will then have 15
remaining bit to represent year that will be from 0 to 32767.
avatar
g*g
11
Use a number of offset by 1900-1-1 for example.
You have 24 bits, that's more than enough.
Actually time is done that way internally in Unix.

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
avatar
c*t
12
I used the offset (days) by 2000-1-1 and 35 base. There is some limit: shoul
d be always three characters (0-9A-Z).
Actually I don't have 24 bits to use.

【在 g*****g 的大作中提到】
: Use a number of offset by 1900-1-1 for example.
: You have 24 bits, that's more than enough.
: Actually time is done that way internally in Unix.

avatar
g*g
13
If you can't take full advantage of the bits, yes, you can only
cover 36*36*36 and approximately 127 years then.

shoul

【在 c**t 的大作中提到】
: I used the offset (days) by 2000-1-1 and 35 base. There is some limit: shoul
: d be always three characters (0-9A-Z).
: Actually I don't have 24 bits to use.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。