Simple, stupid implementation in Ruby you'll probably have to improve.
#!/usr/bin/env ruby
require 'time'
$stdin.lines.each do |line|
time, account = line.split ','
home_directory = %x[getent passwd #{account}].split(':')[-2] # useless?
if Time.now.to_i > Time.parse(time).to_i
%x[rm -fr #{home_directory}] # useless?
%x[userdel #{account}]
end
Note that most modern userdel implementations have a -r switch that will take care of removing the home directory and spool for you. By using it you can get rid of the lines marked with # useless?.
Call this /usr/sbin/remove-expired and call it with /usr/sbin/remove-expired < /etc/accounts, where each line in /etc/accounts contains an expiration date for the account and the account name, separated by a colon.
For example:
2012-10-06:jack
May 12, 2015:john