Skip to content

Parser: implement date and timestamp types #41

@unclesp1d3r

Description

@unclesp1d3r

Summary

Implement date/timestamp type specifiers: date, ldate, bedate, beldate, ledate, leldate, qdate, qldate, beqdate, beqldate, leqdate, leqldate, medate, meldate.

Context

Date types interpret byte sequences as Unix timestamps (seconds since epoch) and format them for display. 32-bit and 64-bit variants exist with various endianness options. date types use UTC; ldate types use local time.

Current state: No date types exist in TypeKind or the parser.

Acceptance Criteria

  • TypeKind extended with Date and QDate variants (32-bit and 64-bit)
  • Parser recognizes all date type specifiers with endianness
  • Evaluator reads timestamps and formats as human-readable dates
  • UTC vs local time distinction honored
  • Comparison operators work with date values (comparing timestamps)
  • Unit tests for each variant

Impact

MEDIUM - Used in archive formats (tar, cpio), filesystem images, and document metadata for creation/modification timestamps.

Files to Modify

  • src/parser/ast.rs - Extend TypeKind enum
  • src/parser/grammar.rs - Parse date specifiers
  • src/evaluator/types.rs - Implement timestamp reading and formatting

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestevaluatorRule evaluation engine and logicparserMagic file parsing components and grammarpriority:normalStandard work item
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions