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

Question

Question

Convert Date/Time to Julian Short Date

asked on May 24, 2016

Hello,

Has anyone had any luck in converting a Date/Time to a Julian short date(What I am needing is the 2 digit year followed by the number of days from the beginning of the year) in Workflow?  I've tried formatting the token but that isn't working.

Thank you in advance!

Terri

0 0

Answers

APPROVED ANSWER
replied on May 25, 2016

You could do it with Token Calculator.

The first 2 digits would be just %(Date#"yy"#). The day calculation requires subtracting the current date from Dec 31st of the previous year (or to avoid complications calculating the previous year, subtract from Jan 1st this year and add 1).

 

2 0
SELECTED ANSWER
replied on May 24, 2016 Show version history

Token formatting would be my suggestion, based on previous discussion going from Julian to Gregorian (the opposite direction). Can you elaborate on what isn't working?

0 0
replied on May 24, 2016

Thank you Brianna- I saw that article too but they are trying to convert a julian date to a standard date- I am trying to do the opposite 

0 0
replied on May 24, 2016 Show version history

You were too fast for me! I just updated my post. Basically, the opposite should work just fine as far as I'm aware, so can you elaborate on your issue?

0 0
replied on May 24, 2016

:)  For example- I would like for Workflow to convert  a field with the value 05/02/2016 06:55:59 PM and pass the julian short date 16123 to another field

 

0 0
replied on May 24, 2016

I meant what is it that you've tried:

I've tried formatting the token but that isn't working.

It should be possible to go the other direction using similar methods as those in the post I linked.

0 0
replied on May 24, 2016

Hi Brianna- I tried to format the date using the format constraints that mainframe systems use YYDDD but that did not work.

0 0
replied on May 24, 2016 Show version history

I can do it in Excel with the following formula- =TEXT(A2,"yy")&TEXT((A2-DATEVALUE("1/1/"&TEXT(A2,"yy"))+1),"000") but I would really rather Workflow make the conversion.

0 0
replied on May 24, 2016 Show version history

Can you post a screenshot of your attempt? It's difficult to debug without information on what specifically you are trying. :)

0 0
replied on May 24, 2016

Right now I am doing a lookup because I couldn't make the formatting work so a screenshot would probably not be that helpful.

 

0 0
replied on May 24, 2016

From my limited experience, I'd recommend trying the token formatting again, and posting what you've tried: often it's difficult to spot your own regular expression mistakes.

If you're stuck as to where to start, perhaps someone with more knowledge on the topic can post their suggestion :D

0 0
replied on May 24, 2016 Show version history

Thanks Brianna for looking at it!  I've decided to go with the script method to accomplish this.

0 0
APPROVED ANSWER
replied on May 25, 2016

You could do it with Token Calculator.

The first 2 digits would be just %(Date#"yy"#). The day calculation requires subtracting the current date from Dec 31st of the previous year (or to avoid complications calculating the previous year, subtract from Jan 1st this year and add 1).

 

2 0
replied on May 25, 2016

Thank you so much Miruna- You always make everything look so easy :)

 

0 0
replied on May 25, 2016

It was supposed to be even easier, but I found 2 bugs going that route. So thank you for that!wink

1 0
replied on November 29, 2018

I think that this is exactly what I need, thank you!

0 0

Replies

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

Sign in to reply to this post.