Time::DATE_FORMATS[:db2] = '%Y-%m-%d %H:%M:%S'

Time::DATE_FORMATS[:default] = ->(time){
  Time.zone = 'Beijing'
  t = Time.zone.at time
  t.strftime '%Y-%m-%d %H:%M:%S'
}

Time::DATE_FORMATS[:sh] = ->(time){
  t = Time.zone.at time
  t.strftime '%y-%m-%d %H:%M:%S'
}

Time::DATE_FORMATS[:date] = ->(time){
  t = Time.zone.at time
  t.strftime '%Y-%m-%d'
}

Time::DATE_FORMATS[:h] = ->(time){
  t = Time.zone.at time
  t.strftime '%H:%M'
}

Time::DATE_FORMATS[:datetime] = '%Y-%m-%d %H:%M'

Date::DATE_FORMATS[:date] = ->(date){
  date.strftime '%Y-%m-%d'
}
