如何在sqlite中比较格式“MMM d,yyyy hh:mm:ss a”的日期

时间:2015-11-10 08:08:30

标签: android sqlite android-sqlite

enter image description here

我的查询:

function chnageBGDynamic(file_id_ch,change_bg_id,is_aled_othr){

    var files = !!file_id_ch.files ? file_id_ch.files : [];
    if (!files.length || !window.FileReader) 
        return; // no file selected, or no FileReader support
    if (/^image/.test( files[0].type)){ // only image file
        var reader = new FileReader(); // instance of the FileReader
        reader.readAsDataURL(files[0]); // read the local file            
        reader.onloadend = function(){ // set image data as background of div
            $("#"+change_bg_id).css("background-image", "url("+file_id_ch.result+")"); // here is the problem it dosent gets changed. i get a blank background and when checked by inspect element i get undefined src
            $("#"+change_bg_id).css("background-size", "cover");
        }}else{
            if(is_aled_othr =='0'){
                alert('Only Images Are Allowed to Upload '); return false;
            }else{
            $("#"+change_bg_id).css("background-image", "url(avator/icon/noticei.png)");
            $("#"+change_bg_id).css("background-size", "85%");
            $("#"+change_bg_id).css("background-repeat", "no-repeat");
            }
    }

}

1 个答案:

答案 0 :(得分:1)

您需要以YYYY-MM-DD HH:MM:SS或毫秒差异的形式保存日期,以便在sqlite中对其进行比较。