Question:
How do I deal with formatting of dates? I want to force a certain standard and I want to customize how the date is formatted. I used an input mask, but that doesn't seem to be working either.
Answer:
Input masks do not change the physical data they only show you a visual mask of the physical data. In order to change the physical data and bend it to your configuration will you have to use Regex Custom Formatting.
Example Date: 12125/2013 (Notice that one of the slashes(/) has been marked as a physical "1". How in the world do I format this to the proper date and force the formatting I need? Say for this example I want the format to be 25/12/2013. Regular Expressions with custom formatting can do this no problem.
Create a regular expressions that matches in groups
(?\d{2}).(?\d{2}).(?\d{4})
Now in custom formatting I would place these into the positions I want the end format to be
{day}/{month}/{year}
End result in index field: 25/12/2013
You can also switch these around for different results
{year}-{month}-{day}
End result in index field: 2013-12-25
Attached a screen shot of where this is located within Indexing as well.
Comments
Please sign in to leave a comment.