Skip to content

Commit 4515fbc

Browse files
authored
Merge pull request #3631 from rosstitmarsh/fix-3463-timestamp-invalid-when-nanos-zero
Fix timestamp being invalid if nanoseconds component is zero
2 parents ec85f8a + 5bb483f commit 4515fbc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/pv-pva/src/main/java/org/phoebus/pv/pva/Decoders.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ static Time decodeTime(final PVAStructure struct)
172172
// In addition, a time stamp of 1990/01/02 00:00:00
173173
// as used for the Channel Access and IOC time stamp epoch
174174
// is considered invalid because IOCs send it for never processed records
175-
final boolean valid = timestamp.getNano() != 0 &&
176-
(timestamp.getEpochSecond() > 0 && timestamp.getEpochSecond() != EPICS_EPOCH);
177-
return Time.of(timestamp, usertag, valid);
175+
final boolean valid = !(timestamp.getEpochSecond() == 0 && timestamp.getNano() == 0) &&
176+
timestamp.getEpochSecond() != EPICS_EPOCH;
177+
return Time.of(timestamp, usertag, valid);
178178
}
179179

180180
/** @param printfFormat Format from NTScalar display.format

0 commit comments

Comments
 (0)