NiVO / BY TECHNOGISGermany · Indonesia
Delivery metadata tutorial

ZIP Member Times: Separate Archive Modification Metadata from Drone Capture Time

Run an in-memory ZIP timestamp round trip, observe two-second central-directory precision, and avoid assigning a timezone or image capture meaning that the field does not supply.

ZIP Member Times: Separate Archive Modification Metadata from Drone Capture Time

Identify which timestamp a delivery tool is displaying

A ZIP delivery can show a date beside every image or data file, but that date is not automatically the time the drone captured the content. The archive contains member metadata, while an image may contain its own acquisition metadata and the surrounding filesystem may show another time again. Before using a package listing to align photographs with a log, identify exactly which field the tool displays. Similar calendar strings can refer to different events and can have different precision or timezone information.

This tutorial creates one small constructed ZIP archive in memory and compares a requested member modification tuple with the tuple read from its central directory. It does not inspect a customer package, alter an original photograph, extract files, or establish the time of a NiVO flight. The example makes a storage limitation visible through an actual local round trip. The product photograph supplies separate catalogue context. Its presence does not imply that the constructed text member represents a camera file or contains a real acquisition timestamp.

Read the central-directory time with its own contract

Python documents ZipInfo.date_time as a six-part tuple for the member last-modification date and time from the ZIP central directory. The fields are year, month, day, hour, minute, and second. The current documentation explains that this central-directory timestamp is interpreted as local time rather than UTC. It also distinguishes that timestamp from additional formats that can occur in ZIP extra fields. A reader of date_time alone should not claim that it has inspected every timestamp representation stored in a real archive.

PKWARE describes the ordinary ZIP date and time fields as MS-DOS encoding with two-second precision and years relative to 1980. Those limitations matter when a reviewer expects a package listing to preserve every second of a source time. They also do not supply a reliable timezone offset for the six-value tuple. Retain the field source and its interpretation rather than adding a UTC suffix merely because a downstream table expects one. A timezone conversion needs justified source context that this ordinary tuple by itself does not provide.

Restored NiVO VTOL V3 product image from the supplied brochure
Restored NiVO VTOL V3 product image from the supplied brochure.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Observe the timestamp through an in-memory round trip

Run the Python example locally. The function validates a six-integer calendar tuple within the ordinary ZIP year range, creates a BytesIO buffer, writes one fixed text member with no compression, and reads it back. It reports the requested tuple, the stored central-directory tuple, whether the teaching payload is unchanged, and the number of extra bytes on that member. Nothing is written to the filesystem. The code uses an explicitly supplied toy modification time, rather than borrowing the computer current time or modifying a real delivery.

The constructed request uses 10:20:31 on the stated teaching date. Reading it back should show 10:20:30 in the ordinary member timestamp, while the text payload remains unchanged. That observation demonstrates the result of this writer and reader at the field precision described by PKWARE. It does not establish an acquisition event at either second. The function does not infer an offset, attach a timezone, parse image metadata, or reconcile other timestamp extra fields. Its empty-extra-field result applies to the archive it constructs here.

from datetime import datetime
from io import BytesIO
from zipfile import ZipFile, ZipInfo, ZIP_STORED

def zip_time_roundtrip(stamp):
    if (type(stamp) is not tuple or len(stamp) != 6
            or any(type(x) is not int for x in stamp)
            or not 1980 <= stamp[0] <= 2107):
        raise ValueError("Expected six integer calendar fields within ZIP years")
    datetime(*stamp)  # Validate calendar fields; do not assign a timezone.
    payload = b"Constructed teaching payload\n"
    buffer = BytesIO()
    with ZipFile(buffer, "w", compression=ZIP_STORED) as writer:
        writer.writestr(ZipInfo("teaching.txt", date_time=stamp), payload)
    buffer.seek(0)
    with ZipFile(buffer, "r") as reader:
        info = reader.getinfo("teaching.txt")
        return {"requested": stamp, "stored": info.date_time,
                "payload_unchanged": reader.read(info) == payload,
                "extra_bytes": len(info.extra)}

# Constructed member modification time, not a photo capture event.
print(zip_time_roundtrip((2026, 11, 28, 10, 20, 31)))

Keep lost precision separate from clock offset

An odd-second request and the preceding even-second request can produce the same ordinary stored timestamp in this example. The read tuple cannot recover which original request was supplied. Do not treat that ambiguity as a measured clock offset or repair it by adding a guessed second. The observed difference concerns representation precision. A real clock comparison needs identified events, clock sources, and a supported association method. The archive field alone cannot reveal whether an image was captured, copied, edited, or packaged at the displayed moment.

Test an even-second request independently and confirm that the round trip preserves that second. Then compare two requests that collapse to the same tuple. These cases make the information loss visible without assuming a real sensor or camera clock. A report should distinguish the supplied test input from the stored result. Likewise, do not infer that the payload changed merely because its archive metadata changed, or that an unchanged payload proves that all timestamps in an external package are original or trustworthy.

Inspect additional timestamp sources as separate evidence

A real ZIP can carry extra fields and may have been produced by tools with different timestamp policies. Python exposes extra bytes separately from date_time, and its documentation notes that multiple timestamp representations can exist. This tutorial deliberately constructs no timestamp extra fields and does not parse any. If another application displays a different time for the same member, inspect which representation it uses before claiming a disagreement in file contents. Record the application and archive identity so that the comparison remains reproducible.

For photographs, preserve the original image metadata and any producer documentation about acquisition time, timezone offsets, subseconds, and editing history. Those records answer a different question from member last-modification metadata. An archive name containing a date is also a naming convention rather than independent evidence of capture. Keep these sources labeled when building an inventory. A combined table can be useful, but merging them into one unnamed timestamp column makes it harder to explain which event and precision each value actually represents.

Deliver a timestamp inventory without inventing capture history

For an actual delivery review, record the unchanged archive identity, specific member record, central-directory tuple, available extra-field evidence, tool version, and any independently verified timestamp policy. Preserve separate columns for archive metadata and identified acquisition metadata. If timezone context is unresolved, report that limitation instead of silently treating local time as UTC. Any later reconciliation should explain its source evidence and method. Keep the original package available rather than rewriting timestamps merely to make an inventory appear consistent.

In a NiVO-related delivery discussion, this small round trip can explain why a package listing lacks the precision or context needed for image-log matching. Another reviewer can reproduce the two-second storage observation while seeing that it establishes no actual flight event. Continue any required capture-time interpretation and survey alignment with their appropriate evidence. The useful outcome is a clear account of which archive field was read, how this example stored it, and which conclusions remain unsupported by that metadata alone.

Also distinguish the modification time of the ZIP file itself from the member timestamps inside it. Repackaging or transferring a container can affect the surrounding file metadata without proving that every member date changed. Conversely, a member date is not automatically the container creation date. This tutorial keeps its buffer entirely in memory, so it makes no filesystem timestamp claim at all. That narrow scope helps isolate the ordinary member field before a larger delivery-history investigation introduces additional events.

Technical references

  1. Python zipfile: ZipInfo.date_time and timestamp sources ↗
  2. PKWARE APPNOTE section 4.4.6: MS-DOS date/time precision ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team