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?
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?
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.
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.
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.
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.
相关阅读
再次请教个linux组合问题2爷一走,groupon起来了。Backbone + Typescript简直是灾难Telerik给我发了个优惠价邮件。猎头发过来的某软硬件大公司问题scala 问题请教 -- scala.runtime.Tuple2Zipped有想一起创业的game developers吗?亚麻內推和磨面 (转载)我觉得王垠对Agile的看法很有道理啊我这样把一个2D array 的每个column的数据导入到1D array的方法对不对?Swift看得我头大。knuth讲过,越流行的东西 越要摒弃xamarin被软买了怎样在Python里调用Visual C++的函数?visual studio 2015 free了?阳光底下无新鲜事,软件业这些新制度早玩过了Job openings for SWE of all levels, and more (转载)替朋友的公司帮找两位资深Java Server端高手 (转载)简单4步骤打印机Laser Toner Refill方法 (转载)叫个毛啊,本来互联网都是泡沫 (转载)