Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Date problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Date problem" Watch "Date problem" New topic
Author

Date problem

Pinal N Patel
Ranch Hand

Joined: Sep 05, 2003
Posts: 57
Hello everyone,

I am building a web page with functionality for user to upload (using the browse function) their pictures (jpeg format) into the application. Once the picture is uploaded, I display the picture in a thumbnail fashion along with date/time of when the picture was taken. I am reading the Jpeg's Exif data using Open source tool called "Metadata Extractor" to retrieve picture taken time for display purpose.

The problem is that when I read the picture taken time, which is of Date object, I can not read the timezone information from the date object. Rather, I can not even modify it; the date object gets assigned the default timezone on where the server is located.

For example: If I take a picture at 2PM in EST timezone and if the server is in PST timezone, then when I upload the jpeg, the date object is misrepresented with 2PM of PST (PST is added to the date obects as a default server timezone) when the correct time is 2PM of EST. In this case, the date/time data is incorrect.

Please kindly provide any insight to resolve this issue. I appreciate any help I can get.

Thanks in advance as always!!

Regards
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Date objects do not have a notion of timezone. You should check out Calendar and GregorianCalendar instead.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date problem
 
Similar Threads
want client's time zone from server side
java.sql.ResultSet getTimestamp Locale issue
How to read picture taken time from JPEG
want client's time zone from server side
Time Zone problem