Stories
Slash Boxes
Comments

Slash Open Source Project

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • by pudge (6) on Saturday January 05 2002, @02:21PM (#3921) Homepage
    Templates can do all this. You'll need to learn how to modify templates, how to use the Template language, etc. For this task, Template comes with a date plugin. So you could, for example, do:

    [% USE date; date.format(date.now, "%A, %B %d, %Y") %]
    • I tend to just use our own Slash.timeCalc() though since it will adjust the time to the user's timezone.
      --

      --
      You can't grep a dead tree.
      • Yeah, good call. I was just thinking of a more general Template solution, but in Slash, the date plugin is rarely needed, since Slash.timeCalc() does what you need most of the time.
      • Krow, but I think Slash.timeCalc() does not work from within a template (it works from a .pl) so Pudge's code above seems like the only way to go (he provided that solution to on #slash me a few weeks ago.)
        • Yes it does. If you are using versions less then 2.2 (aka anything not from CVS) you need to put this as the first line of your template:

          [% USE Slash %]
          --

          --
          You can't grep a dead tree.