Im trying to create DBF file in FoxPro spec, but idk how to insert date. I dont know how to convert java Date to this:
FoxPro's field is 2 32bit integers: one stores the date, the other stores the time, stored in reverse byte order. The date integer stores the number of days from 1/1/4712BC. The time integer stores the number of milliseconds from 00:00:00.
Its easy to get days and milliseconds with JodaTime:
DateTime start = new DateTime(-4713, 1, 1, 0, 0, 0, 0);
DateTime end = new DateTime(2014, 1, 1, 0, 0, 0, 0);
Days days = Days.daysBetween(start, end);
long millis = end.getMillisOfDay();
but how to convert this info to needed format? For input a date I just use:
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyyMMdd");
simpledateformat.format(date);
and its work fine, but when I try use datetime with "yyyyMMddHHmmss"
I see very bad result, like 17.08.33409 12:34:20 (only month is correct).