According to the specification
http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current
Modification time (mtime) is computed as number of seconds since epoch taken as
UTC time.
If a user passes a UTC datetime value the result TAR file will be invalid,
since the TarHeader class computes timestamp as difference between TheEpoch
constant taken as local time.
It is suggested to create TheEpoch constant with explicit choice of UTC date
time:
DateTime TheEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
And it is also necessary to compute the difference appropriately:
long ts = (long) (LastModification.ToUniversalTime() - TheEpoch).TotalSeconds;
in the TarHeader.LastModificationString property.
Original issue reported on code.google.com by tpgalche...@gmail.com on 2 May 2012 at 9:41
Original issue reported on code.google.com by
tpgalche...@gmail.com
on 2 May 2012 at 9:41