trac-ticketlinks / trac / prefs / templates / prefs_datetime.html

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="prefs.html" />
  <head>
    <title>Date &amp; Time</title>
  </head>
  <body>

    <div class="field" py:with="session_tzname = settings.session.get('tz');
                                selected_tz = timezone(session_tzname) or utc">
      <label>Time zone:
      <select name="tz">
        <option value="">Default time zone</option>
        <option py:for="tzname in timezones" value="$tzname"
                selected="${session_tzname != None and
                            session_tzname.startswith('Etc/') and
                            selected_tz == timezone(tzname) or
                            session_tzname == tzname or None}">$tzname</option>
      </select></label>
      <p class="hint">Configuring your time zone will result in all
      dates and times displayed on this site to use your time zone
      instead of that of the server.</p>

      <!-- This currently crashes Genshi's extractor if you add i18n:msg -->
      <p class="hint" py:with="now = datetime.now(utc);
                               nowtz = selected_tz.normalize(now.astimezone(selected_tz))"
                      py:choose="">
        <i18n:msg params="time">Example: The current time is <strong>${format_time(now, 'iso8601', tzinfo=utc)}</strong> (UTC).</i18n:msg>
        <br />
        <py:when test="session_tzname">
          <i18n:msg params="tz, formatted">
            In your time zone ${nowtz.tzname()}, this would be displayed as
            <strong>${format_time(now, 'iso8601', tzinfo=req.tz)}</strong>.
          </i18n:msg>
        </py:when>
        <py:otherwise>
          <i18n:msg params="formatted">
            In the default time zone, this would be displayed as
            <strong>${format_time(now, 'iso8601', tzinfo=req.tz)}</strong>.
          </i18n:msg>
        </py:otherwise>
      </p>

      <p class="hint" i18n:msg="">
        Note: Universal Co-ordinated Time (UTC) is also known as Greenwich Mean Time (GMT).<br />
        A positive offset is used to indicate a timezone at the east of Greenwich, i.e. ahead of Universal Time.
      </p>

    </div>

  </body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.