<commit_before>/**
 * gets the dataset date from filename if in format yyyy-mm-dd-hh
 * @access public
 *
 * @param filename {String} the filename
 *
 * @return {Date} date object (false if parsing was not successful)
 */
export default function parseFileName(filename) {
    const match = /(\d{4})-(\d{2})-(\d{2})-(\d{2})/.exec(filename);

    if (match) {
        return new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]), Number(match[4]));
    } else {
        return false;
    }
}
<commit_msg>Fixing bug which caused the parsed dates to be local-time-denendent<commit_after>/**
 * gets the dataset date from filename if in format yyyy-mm-dd-hh
 * @access public
 *
 * @param filename {String} the filename
 *
 * @return {Date} date object (false if parsing was not successful)
 */
export default function parseFileName(filename) {
    const match = /(\d{4})-(\d{2})-(\d{2})-(\d{2})/.exec(filename);

    if (match) {
        return new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), Number(match[4])));
    } else {
        return false;
    }
}

{'fraction_non_alphanumeric': 0.16941391941391942, 'fraction_numerical': 0.016483516483516484, 'mean_word_length': 3.389558232931727, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3208453', 'n_tokens_mistral': 361, 'n_tokens_neox': 350, 'n_words': 103}