mirror of
https://github.com/edgewall/trac.git
synced 2026-02-05 18:45:55 +01:00
[skip ci] git-svn-id: http://trac.edgewall.org/intertrac/log:/trunk@17657 af82e41b-90c4-0310-8c96-b1721e28e2e2
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
# Copyright (C) 2007-2023 Edgewall Software
|
|
# Copyright (C) 2007 Christian Boos <cboos@edgewall.org>
|
|
# All rights reserved.
|
|
#
|
|
# This software is licensed as described in the file COPYING, which
|
|
# you should have received as part of this distribution. The terms
|
|
# are also available at https://trac.edgewall.org/wiki/TracLicense.
|
|
#
|
|
# This software consists of voluntary contributions made by many
|
|
# individuals. For the exact contribution history, see the revision
|
|
# history and logs, available at https://trac.edgewall.org/.
|
|
|
|
"""Inserts the current time (in seconds) into the wiki page."""
|
|
|
|
from trac.util.datefmt import datetime_now, format_datetime, utc
|
|
from trac.util.html import tag
|
|
from trac.wiki.macros import WikiMacroBase
|
|
|
|
revision = "$Rev$"
|
|
url = "$URL$"
|
|
|
|
|
|
class TimestampMacro(WikiMacroBase):
|
|
_description = "Inserts the current time (in seconds) into the wiki page."
|
|
|
|
def expand_macro(self, formatter, name, content, args=None):
|
|
t = datetime_now(utc)
|
|
return tag.strong(format_datetime(t, '%c'))
|