Is there any way I can convert a string (either \d\d\d\d\d\d or \d\d/\d\d/\d\d) to a Date in Quickfields? I've looked all over, and I can't find the answer. Please help!
Question
Question
Answer
I figured it out. My first two digits were my year, but when I was doing the substitution I was putting the year in the front! I feel so dumb. Thanks for your help!
Replies
Alternately - if there's a way to get pattern matching to pull a date out of a string where the date is separated by hyphens instead of "/" that would work....
My initial input is blahblah-yy-MM-dd-blahblah I'm picking the text up through OCR. If I pull the date out via \d\d-\d\d-\d\d it becomes a string object instead of a date object. Help!
Hello Tonya,
If i am am understanding what you are asking correctly, you can use \d\d-\d\d-\d\d\d\d. I tested this in Workflow with the input string of asdfs5646540502-03-201681681s888s1 and it does extract the date correctly as 02-03-2016.
It will extract the date correctly as a String, but I need the token to go into a Date field, so how do you find
-(yy-MM-dd)-
Am I missing \ or / or % or #?
I would use three unique tokens, YToken, MToken, and DToken, to extract the parts of the date so that you can reconstruct the date in the order needed, yy-MM-dd. Your dialogue for the metadata entry of the tokens would then be %YToken-%MToken-%DToken.
\d\d- will return MToken
-\d\d-(\d\d) will return YToken
\d\d-(\d\d)-\d\d\d\d will return DToken