For a given Date object, capture it's value relevant to GMT timezone
问题 In my application running on Java 8, I have a Date object. The timezone for this object depends on the client's location. At one particular point, I need to convert this Date to GMT so that it could be comparable to a value that I access from the DB. I tried SimpleDateFormat and ZonedDateTime, but there's a pain-point. These API's provide me GMT time in String values, which is perfectly fine. However, once I parse it and assign it to a Date object, it is back to my local timezone! For Ex: