<commit_before>

module.exports = _formatDate
module.exports.dbDate = formatDBDate;
module.exports.fileDate = formatFileDate;

function formatDBDate(date){
  //year-month-day hour:minutes:seconds
  var o = _formatDate(date);
  return o.year+'-'+o.month+'-'+o.day+' '+o.hours+':'+o.minutes+':'+o.seconds;
}

function formatFileDate(date){
  //year-month-day_hourminutesseconds
  var o = _formatDate(date);
  return o.year+'-'+o.month+'-'+o.day+'_'+o.hours+''+o.minutes+''+o.seconds;
}

function _formatDate(d){
  return {
    day:pad(d.getDate())
  , month:pad(d.getMonth()+1)
  , year:d.getFullYear()
  , hours:pad(d.getHours())
  , minutes:pad(d.getMinutes())
  , seconds:pad(d.getSeconds())
  }
}


function pad(n,t){
  t = t||2;
  n = n+"";
  while(n.length < 2) n = "0"+n;<commit_msg>utc opt<commit_after>

module.exports = _formatDate
module.exports.dbDate = formatDBDate;
module.exports.fileDate = formatFileDate;

function formatDBDate(date,utc){
  //year-month-day hour:minutes:seconds
  var o = _formatDate(date,utc);
  return o.year+'-'+o.month+'-'+o.day+' '+o.hours+':'+o.minutes+':'+o.seconds;
}

function formatFileDate(date,utc){
  //year-month-day_hourminutesseconds
  var o = _formatDate(date,utc);
  return o.year+'-'+o.month+'-'+o.day+'_'+o.hours+''+o.minutes+''+o.seconds;
}

function _formatDate(d,utc){
  return {
    day:pad(utc?d.getUTCDate():d.getDate())
  , month:pad(utc?d.getUTCMonth()+1:d.getMonth()+1)
  , year:utc?d.getUTCFullYear():d.getFullYear()
  , hours:pad(utc?d.getUTCHours():d.getHours())
  , minutes:pad(utc?d.getUTCMinutes():d.getMinutes())
  , seconds:pad(utc?d.getUTCSeconds():d.getSeconds())
  }
}


function pad(n,t){
  t = t||2;
  n = n+"";
  while(n.length < 2) n = "0"+n;
{'fraction_non_alphanumeric': 0.21536670547147846, 'fraction_numerical': 0.005238649592549476, 'mean_word_length': 4.96875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '429403', 'n_tokens_mistral': 731, 'n_tokens_neox': 717, 'n_words': 88}