• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/CPANInternal-159.1/Template-Toolkit-2.25/lib/Template/Plugin/

Lines Matching +refs:original +refs:date

7 #   Plugin to generate formatted date strings.
65 # Returns a formatted time/date string for the specified time, $time,
85 my (@date, $datestr);
90 @date = (gmtime($time))[0..6];
93 @date = (localtime($time))[0..6];
106 @date = @parts[reverse 0..5];
110 @date = @parts[2,1,0,3..5];
114 if (!@date) {
115 return (undef, Template::Exception->new('date',
116 "bad time/date string: " .
119 $date[4] -= 1; # correct month number 1-12 to range 0-11
120 $date[5] -= 1900; # convert absolute year to years since 1900
121 $time = &POSIX::mktime(@date);
125 # format the date in a specific locale, saving and subsequently
138 $datestr = &POSIX::strftime($format, @date);
142 $datestr = &POSIX::strftime($format, @date);
165 die (Template::Exception->new('date', join(', ', @_)));
214 Template::Plugin::Date - Plugin to generate formatted date strings
218 [% USE date %]
221 [% date.format %]
225 [% date.format(960973980) %]
226 [% date.format('4:20:36 21/12/2000') %]
227 [% date.format('2000/12/21 4:20:36') %]
230 [% date.format(mytime, '%H:%M:%S') %]
233 [% date.format(date.now, '%a %d %b %y', 'en_GB') %]
236 [% date.format(mytime, format = '%H:%M:%S') %]
237 [% date.format(locale = 'en_GB') %]
238 [% date.format(time = date.now,
243 [% USE date(format = '%H:%M:%S', locale = 'de_DE') %]
245 [% date.format %]
250 The C<Date> plugin provides an easy way to generate formatted time and date
255 [% USE date %]
257 This creates a plugin object with the default name of 'C<date>'. An alternate
260 [% USE myname = date %]
269 [% USE date(format = '%a %d-%b-%Y', locale = 'fr_FR') %]
276 [% date.format %]
278 The plugin allows a time/date to be specified as seconds since the epoch,
281 File last modified: [% date.format(filemod_time) %]
283 The time/date can also be specified as a string of the form C<h:m:s d/m/y>
287 [% USE day = date(format => '%A', locale => 'en_GB') %]
297 [% date.format(filemod, '%d-%b-%Y') %]
298 [% date.format(filemod, '%d-%b-%Y', 'en_GB') %]
303 [% date.format(filemod, '%d-%b-%Y', 'en_GB', 1) %]
312 [% date.format(format => '%H:%M:%S') %]
313 [% date.format(time => filemod, format => '%H:%M:%S') %]
314 [% date.format(mytime, format => '%H:%M:%S') %]
315 [% date.format(mytime, format => '%H:%M:%S', locale => 'fr_FR') %]
316 [% date.format(mytime, format => '%H:%M:%S', gmt => 1) %]
322 [% date.format(date.now, '%A') %]
327 [% calc = date.calc %]
333 [% manip = date.manip %]
338 Thierry-Michel Barral wrote the original plugin.