Create Today’s Date with TypoScript

by Michael Cannon in TYPO3 · 0 comments

I forgot how to format Unix timestamps with TypoScript. Here’s my findings using today’s date.

The first code snippet, is years old. The second TypoScript snippet comes from my deeper reading of the TypoScript Reference documentation in my want to write “better” code.

“old” today’s date TypoScript

lib.date = TEXT
lib.date {
  data = date:U
  strftime = %B %e, %Y
  wrap = Today is |
}

“new” today’s date TypoScript

lib.date = TEXT
lib.date {
  data = date:F j, Y
  noTrimWrap = |Today is ||
}

References

Originally posted January 27, 2009. Revised and link checked.

Be Sociable, Share!

Related Entries

About Michael Cannon

Hello, I'm Michael Cannon, Peichi's smiling man, an adventurous water-ratchief technology officer, cyclist, poet, WWOOF'er and world traveler.

Previous post:

Next post: