question

Upvotes
Accepted
3 1 1 3

What is the right way to make a TIMACT_NS field?

Why is "value" null in the following? What is the right way to make a TIMACT_NS field?

FieldEntry fieldEntry = createFieldEntry();

FieldEntry value = fieldEntry.intValue(TIMACT_NS.fieldId(), TimeUnit.MILLISECONDS.toNanos(timestamp.toEpochMilli()));

#technologyjava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
24.3k 62 15 21

Hi @martin.eriksen,

The TIMACT_NS is a time field rather then an integer field:

TIMACT_NS  "TIMEACT NS"         14269  NULL        INTEGER            15  TIME             8

Please use the time() instead of intValue() method to encode the nanosecond timestamp into the field entry.

See the method signature here.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.