I get this question a lot and there seems to be no clear directions on how to accomplish this, so I decided to put it down on (digital) paper so we can all benefit!
If you have worked with SharePoint ever, and tried to do something with dates, you understand that pain that comes along with a date column... the time stamp. I am not going to go into details on why SharePoint insists that everything has a time, but simply focus on how to remove the time piece within a workflow.
For this sceanrio, I took a super simple approach. I am getting the current date (Add Time to Date) and then formatting a string to only contain the date (Build String). Keep in mind that if you already have a date variable, you can use that variable and skip the first step. So let's go!
Step 1 - Get Today
Here we simply use the Add Time to Date action to get the current date and time (when the action is executed) and that's it. I told you it was simple
Step 2 - Remove Time
No, I am not a wizard, I can't actually remove the passage of time...but I can remove the time stamp from the variable using a Build String action! In your action, click on Advanced Lookup, the Workflow Variables (in the dropdown) and then select your variable you need. At this point, if you already had a variable in place, you can use it, just select it via the Advanced Lookup and not the Insert Reference to the right.
The reason we do it this way is so we can specify how we return the data out of the variable. Click on the "X" to the right of the variable dropdown and you are able to change the date format. Here we want to select "Short Date" in order to get MM/DD/YYYY
So now we have our current date without the time stamp that SharePoint insists giving us! This is great for doing date comparisons or adding date values into a document generation action.
Hope this has been helpful!
Let me know how you solved this issue if you ran into something similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.