TcM1911 / stix2

A pure Go library for working with Structured Threat Information Expression (STIX™) version 2.x data
BSD 2-Clause "Simplified" License
22 stars 6 forks source link

timestamps in stix2 MUST be formatted as UTC #57

Closed pbedat closed 1 year ago

pbedat commented 1 year ago

When using Timestamps with a location other than UTC, the library currently marshals them "as is"

e.g. "2022-01-02T00:00:00+01:00" instead of "2022-01-01T23:00:00Z"

This change converts the timestamp to UTC before marshalling

codecov[bot] commented 1 year ago

Codecov Report

Merging #57 (0fd3d59) into master (98d3b62) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   99.30%   99.30%           
=======================================
  Files          44       44           
  Lines        2009     2009           
=======================================
  Hits         1995     1995           
  Misses          7        7           
  Partials        7        7           
Impacted Files Coverage Δ
data-types.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.