• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jar tool wrong last modified time for html files

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I got a strange problem with the jar tool (JDK 5.0) both on Windows and on Linux.
Do the following:
on the command prompt, go to the directory containing your instructions.html file (URLyBird).
Take note of the last modified time (using dir or ls command)
Now jar the html file into a simple test jar like so:

jar -cf myjar.jar instructions.html

When you now look inside myjar.jar (using winzip on Windows, or File Roller on Linux) you will notice that the modified time differs by one hour, well at least in my case.

example:

You will notice that the modified time of the html file is approx 14:00h, however the html file inside the jar shows a last modified time of 15:00h ???

How can this be ?

The funny thing is that if I look inside the jar using the jar command itself, the last modified time looks ok:



So it looks like this is a problem both for Winzip and File Roller...
Anyone else notice this ?

Regards,
Ronald Wouters
[ February 07, 2006: Message edited by: Ronald Wouters ]
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ronald,

I think you will find that the jar tool is storing dates and times in GMT, and converting them back to local time again later. 1 hour out should be right for Belgium. And mine look roughly right for Australia:Regards, Andrew
 
Ronald Wouters
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Andrew for clearing that up.
I suspected as much, that it must have had something to do with timezones I mean. Glad you could confirm it. Didn't find anything in the JDK tool docs though about the jar tool storing times in GMT.
I guess Winzip and File Roller are too smart for there own good

Regards,
Ronald Wouters
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic