
bryancarney at gmail
Jul 19, 2012, 5:49 AM
Post #4 of 4
(658 views)
Permalink
|
Thanks guys -- getting as an object is the piece I was missing. Cheers, Bryan On Thu, Jul 19, 2012 at 7:40 AM, David E. Wheeler <david [at] justatheory>wrote: > On Jul 18, 2012, at 11:42 PM, Bryan Carney wrote: > > > I had to go a bit roundabout to get the date in my desired format, but 7 > > days prior to a cover date because I can't find documentation on the > > options of story->get_cover_date or an alternative > > You can pass a strftime format to get_cover_date. One of the options is > "object", which will return the underlying DateTime object that you can > then manipulate: > > my $dt = $story->get_cover_date('object')->subtract(days => 7); > my $coverstring = $dt->strftime('%e %B %Y'); > > See the DateTime docs for all the details. > > http://metacpan.org/module/DateTime > > If you don't need to do date mat, you can just pass a strftime format to > any accessor that returns a date: > > $story->get_cover_date('%e %B %Y'); > > > Can someone recommend some reading? > > See the documentation for "localdate" in Bric::Util::Time for details. > > http://bricolagecms.org/docs/current/api/Bric::Util::Time > > HTH, > > David > >
|