You are viewing limited content. For full access, please sign in.

Question

Question

Workflow - date formats are conflicting

asked on June 7, 2017

There is two formats to choose from with the same code

M - Displays the month and day according to the Workflow Server computer's regional settings.

M - Represents the month as a number from 1 through 12. A single-digit month will be formatted without a leading zero.

I am trying to get the Month output without the leading zero but the first duplicate code keeps overriding my output.

0 0

Answer

SELECTED ANSWER
replied on July 5, 2017

Hi Chad,

This is a bit of a delayed answer, but turns out there's a method in the date formatting syntax to handle this! If you want to use the M format (month as number without leading zero), throw a "%" in front of it to specify that you're using a single format specifier. For example, %M would return 7 for today's date.

You may have found another workaround for this already, but wanted to post this as a reference in case others have the same question.

0 0
replied on July 12, 2017

Thank you! That will be helpful in the future

0 0

Replies

replied on June 8, 2017 Show version history

"M" by itself shows the Month day

"M" in a date pattern (M/d/yyyy) shows the month without leading 0

The way I would work around it is to create a full date token using format "M/d/yyyy".  This will ensure the token value starts with the month and does not have leading Zeros.  Then create a Month token that uses the full date token as it's source and use the regular expression "^(\d+)" to get from the start of the input, 1 or more numbers.

1 0
replied on June 8, 2017

Hi Chad,

I have found a workaround, using the Token Calculator activity:

 

 

I obtain this:

Hope it helps

0 0
replied on July 12, 2017

Originally I could never get this to work, but recently learned that tokens passed to date functions within the token calculator must be tagged as a date using the tag feature in the token editor. I never ran into a problem passing strings as integers so I never knew there was a tagging system

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.