Learn about the top 2016 CMS trends. Read on.


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.

Still stuck? Write us.

  • Ashish

    Hello,
    I want to get difference between two dates in number of days using typoscript.
    please can u provide me some help.