Pregunta

I have been storing date records (Date().getTime()) in an SQLite database with an Integer type. I realize now that Date().getTime() is returning Long values, not Integer.

Is there any way I can rescue the date data that is already stored in the database? Going forward I can reduce the resolution of the time, to make it fit into an integer. (ie. divide by 1000, and cast to int)

I expect that forcing a long value into an integer space has truncated the most significant digits - which might work in my favour, as the dates in question have all occurred within the past 6 months, so can probably be calculated.

question so, how exactly would the long representation of today's date map onto an integer, and how might I use that knowledge (combined with the restricted time range) to build these integers back into their original long values?

Any suggestions?

¿Fue útil?

Solución

Turns out the SQLite database integer type is perfectly capable of storing long values. So the data rescue was unnecessary in the end.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top