Boy oh boy. Now this is something new. Looks like I've been PNG'd on these forums. I can't seem to post any replies any more, only new posts! Now that is seriously weird. Did something break?
Okay, here's what this post is about. I really could use help here. I'm modifying the built-in ActionStreams smugmug plugin to pull further information. I've got the information drawing in correctly. My issue is with the rendering of that information.
Specifically:
- I pull the date of the photograph. That's not the ActionStream date, but the date that smugmug has in its database, drawn from the photo's metadata/exif records.
- The date comes in with the following format: 2007-07-29 09:14:57
- I assume I cannot pass this string to a date variable or tag, as this is a text string not a date string. Is that a correct understanding?
- So the next best thing. I modify the date, ignoring the time. I can do that easily with the trim_to template tag modifier, setting it to trim_to="10".
- That gives me the date in yyyy-mm-dd format. I want something more human-readable, in mm/dd/yyyy format, or, where I come from, dd/mm/yyyy format (because, looking at 3 above, obviously I can't get MMMM dd, YYYY).
- I understand this 'date-flipping' should be possible with the regex_replace template tag modifier. And that's the problem. I can't wrap my head around regexes. Can someone tell me how I do that, or if there is a better way to achive this result?
Thanks a lot.
Reported on Movable Type 4.2

You'll probably have to write a "custom handler" for this. Off the top of my head, this Perl code should do it for you in terms of splitting up the above date into an array that you can put back together as you see fit:
my @dateParts = split(/[-\s\:]+/, "2007-07-29 09:14:57");
my $dateString = $dateParts[1] . '/' . $dateParts[2] . '/'. $dateParts[0] . ' ' . $dateParts[3] . ':' . $dateParts[4] . ':' . $dateParts[5];
If you need some practical examples of how a custom handler looks, I have some in my plugins section at my blog here.
@Mike
Eek!
Thanks anyhoo.