Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Date display in presentation template file
System
new to templating. I captured against "Publish date" text field a date in the format of "MM-DD-YYYY". I am not good at complicated regular expressions. Is it too difficult to accomplish this? Is it possible to display using <iw-case> tag in the presentation template the above .
any code examples how to accomplish this please?
thank you
Find more posts tagged with
Comments
Adam Stoller
Are you saying you want to be able to convert a date in one format (in the DCR) into another format in the generated page (via a PT)?
If so - you only seemed to present one format in your post.
What format is the date in the DCR?
What format do you want it in in the generated page?
As a simple example:
If the date is in YYYY-MM-DD format and you want it in MM/DD/YYY format - you could do something like this within an <iw_perl> statement (assuming $val already contains the date extracted from the DCR):
if ($val =~ m|^(\d{4})-(\d{2})-(\d{2})$|){
$val = "$2/$3/$1";
iwpt_output($val);
}
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
thank you.
the date captured on DCR is in the format of MM-DD-YYYY. I wanted to show that date in the form of January 10, 2002
And I don't know anything is perl. Using PT tags is it possible to do?
thanks
Adam Stoller
You seem to have found a solution from your other thread on this same question, so I'll assume this is essentially a dead-thread now.
However, I'd recommend learning Perl when you find the time - it's a very versatile and useful scripting language (and not just within the context of TeamSite) - which once learned, opens up a LARGE number of possibilities.
If you've have programming experience in Unix shell, or C / C++ type languages - just go for O'Reilly's "Programming Perl", otherwise you might want to start with O'Reilly's "Learning Perl"
Frankly I'd recommend picking up a copy and just reading it - a chapter here, a chapter there, over time - you'll eventually start playing with it and hopefully come to enjoy doing so.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
thank you so much for your recommendation.
I will buy the "Learning Perl" book today and start practicing.
regards