Solved

# represent a birth date as a positive decimal number with the least digits

Posted on 2014-10-18

I am wanting to represent a birth date as a positive decimal number with the least digits. Assuming no one living was born before 1894 (120 years old), we can represent someone's birthday in pseudo code as:

1/1/1894 + NumberOfDays

In VB:

dateadd("d", NumberOfDays,#1/1/1894#)

In Java:

var d = new Date("1/1/1894");

d.setDate(d.getDate() + NumberOfDays);

In this case, the least number of digits would be 5:

1/1/1894 + 44119 = 10/18/2014

Anybody have any tricks to get it down to 4 or even 3 digits? You can only use the numbers between 0 and 9 (what's on a telephone keypad).

TIA