Given then timestamp 1245613885 that is a timestamp in GMT
How do I turn that into Year, Day, Hour, Minute values in Java using the server’s local timezone info?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
java.util.Calendarfor this. It offers asetTimeZone()method (which is by the way superfluous since it by default already picks the system default timezone).If you’d like to present it in a human readable date string, then I’d suggest
SimpleDateFormatfor this.(the output is correct as per my timezone GMT-4)