lib/utils/xml-utils.js
function getDate(node) {
    var text = getText(node);
    if (!text) {
        return undefined;
    }
    if (text.indexOf(':') > 0) {
        return new Date(text);
    }
    var bytes = new DataView(ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(text)));
    var secondsFrom00 = new Int64(bytes.getUint32(0, true), bytes.getUint32(4, true)).value;
    var diff = (secondsFrom00 - EpochSeconds) * 1000;
    return new Date(diff);
}
function getDate(node) {
    var text = getText(node);
    if (!text) {
        return undefined;
    }
    if (text.indexOf(':') > 0) {
        return new Date(text);
    }
    var bytes = new DataView(ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(text)));
    var secondsFrom00 = new Int64(bytes.getUint32(0, true), bytes.getUint32(4, true)).value;
    var diff = (secondsFrom00 - EpochSeconds) * 1000;
    return new Date(diff);
}
function getDate ( node ) { var text = getText ( node ) ; if ( ! text ) { return undefined ; } if ( text . indexOf ( ':' ) > 0 ) { return new Date ( text ) ; } var bytes = new DataView ( ByteUtils . arrayToBuffer ( ByteUtils . base64ToBytes ( text ) ) ) ; var secondsFrom00 = new Int64 ( bytes . getUint32 ( 0 , true ) , bytes . getUint32 ( 4 , true ) ) . value ; var diff = ( secondsFrom00 - EpochSeconds ) * 1000 ; return new Date ( diff ) ; }
Parses date saved by KeePass from XML
@param {Node} node - xml node with date saved by KeePass (ISO format or base64-uint64) format
@return {Date} - date or undefined, if the tag is empty
Parses date saved by KeePass from XML