switch birthdate to DateTime
[freeside.git] / httemplate / view / cust_main / misc.html
index 414ef44..121c052 100644 (file)
   </TR>
 
 % if ( $conf->exists('cust_main-enable_birthdate') ) {
+%   eval "use DateTime;";
+%   die $@ if $@;
+%   my $dt = DateTime->from_epoch(epoch => $cust_main->birthdate,
+%                                  time_zone=>'floating',
+%                                 );
 
   <TR>
     <TD ALIGN="right">Date of Birth</TD>
-    <TD BGCOLOR="#ffffff"><% $cust_main->birthdate ? time2str($date_format, $cust_main->birthdate) : '' %></TD>
+    <TD BGCOLOR="#ffffff"><% $cust_main->birthdate ? $dt->strftime($date_format) : '' %></TD>
   </TR>
 
 % }