Java Server and Client Time
Please can any body help me I have been faced time related problem
regarding client and server time display issue since 1 week.
Description: Actually server is located in Germany when client (example :
india) try to send any message to his contacts it will show the message
sending time is server time (means Germany time).But I should say local
specific time.I user send any then I show message sending time like this.
public static String retrieveFullDateFromDateinAMPM ( Date date ) {
SimpleDateFormat sdf =
new SimpleDateFormat("dd/MM/yy hh:mm a", Locale.getDefault())
;
return sdf.format(date);
}
Here I send date value to my helper method
retrieveFullDateFromDateinAMPM(Date date) and I will return the message
sending time like this : return sdf.format(date); to the web page. But it
shows server located time but I should need to show locale specific time.
Please help me. Advanced Thanks.
No comments:
Post a Comment