Skip to content

Commit

Permalink
feat(destination): skip unix timestamp conversion if already being se…
Browse files Browse the repository at this point in the history
…nt from source (#1560)
  • Loading branch information
yashasvibajpai authored Nov 10, 2022
1 parent e41b37f commit a52cbd7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,11 @@ const handleMetadataForValue = (
formattedVal = formatTimeStamp(formattedVal, typeFormat);
break;
case "secondTimestamp":
formattedVal = Math.floor(
formatTimeStamp(formattedVal, typeFormat) / 1000
);
if (!moment(formattedVal, "x", true).isValid()) {
formattedVal = Math.floor(
formatTimeStamp(formattedVal, typeFormat) / 1000
);
}
break;
case "microSecondTimestamp":
formattedVal = moment.unix(moment(formattedVal).format("X"));
Expand Down

0 comments on commit a52cbd7

Please sign in to comment.