Skip to main content

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

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.


Reply