I'm working on a project where I need to pull person details from an endpoint. There is a field called 'birthday' that is a number that looks like something like this: 558289857 Any idea what form this is and how I can convert that to a date?
Asked
Active
Viewed 52 times
0
-
1formate you getting is in long type see this ans : http://stackoverflow.com/a/7487489/4146722 – Pratik Tank Feb 07 '16 at 05:11
-
1post what you have tried so far. – Prafulla Kumar Sahu Feb 07 '16 at 05:11
1 Answers
0
long birthDateLong = Long.parseLong(inputMap.get("birthday")); //Assuming a string
Date birthDay = new Date(birthDateLong);
//This gives you, for your example (558289857), Wed Jan 07 13:04:49 SAST 1970. Perhaps only the date and month are meanto to be meaningful? Check your data.

ernest_k
- 44,416
- 5
- 53
- 99