Reputation: 15744
I am using this Java Code:
Calendar lCDateTime = Calendar.getInstance();
date = lCDateTime.getTimeInMillis();
It gives me Milliseconds. I need to put that in MySQL table and then retrieve the same info; is this possible? Or should I use a different method due to MySQL limitations?
Upvotes: 0
Views: 750
Reputation: 15572
I'd use BigInteger unsigned to have maximum precision although BigInteger signed would probably be enought.
BigInteger unsigned has a max value of 18446744073709551615 which is a long way in the future! (over 31000 AD!) This should be big enough for you... ;)
Currently as of today the ms since 1970 is aroudn about 134670551800 so you have more than enough room to play with.
Here's the link to the Integer values of MySql
I think it would be advisable to map this to a long in Java to store. Long has a maximum value of 9223372036854775807 which is again a long way into the future
Upvotes: 1