Lines 1264-1271
sub get_age {
Link Here
|
1264 |
|
1264 |
|
1265 |
return unless $self->dateofbirth; |
1265 |
return unless $self->dateofbirth; |
1266 |
|
1266 |
|
1267 |
my $date_of_birth = dt_from_string( $self->dateofbirth ); |
1267 |
#Set timezone to floating to avoid any datetime math issues caused by DST |
1268 |
my $today = dt_from_string->truncate( to => 'day' ); |
1268 |
my $date_of_birth = dt_from_string( $self->dateofbirth, undef, 'floating' ); |
|
|
1269 |
my $today = dt_from_string(undef, undef, 'floating')->truncate( to => 'day' ); |
1269 |
|
1270 |
|
1270 |
return $today->subtract_datetime( $date_of_birth )->years; |
1271 |
return $today->subtract_datetime( $date_of_birth )->years; |
1271 |
} |
1272 |
} |
1272 |
- |
|
|