• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Date problem

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Date objects do not have a notion of timezone. You should check out Calendar and GregorianCalendar instead.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic