Skip to main content
Question

Remove decimals of a second

  • January 31, 2019
  • 1 reply
  • 284 views

hlouie
Contributor
Forum|alt.badge.img+16

I'm creating an attribute for storing start date/time of processing with AttributeCreator and I'm having a hard time removing the decimal of a second.

 

@DateTimeFormat(@DateTimeNow(local),%a %b %d %H:%M:%S PST %Y)

 

Output

Thu Jan 31 11:16:20.9415159 PST 2019

 

Want

Thu Jan 31 11:16:20 PST 2019

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • 648 replies
  • January 31, 2019

Hi @hlouie

The following will truncate the timestamp

@DateTimeFormat(@int(@DateTimeNow(localUnzoned)),%a %b %d %H:%M:%S PST %Y)

while this will round the timestamp

@DateTimeFormat(@round(@DateTimeNow(localUnzoned),0),%a %b %d %H:%M:%S PST %Y)

Both should output the timestamp in the format that you want. I hope this helps.