Android: Canvas Draw self -rotating bitmap

2023-01-03   ES  

Demand and thinking

 需求文件
Need to focus on thisEnd timeWhen you want to show upside down. The idea is to use the settimeout () function.

encountering problems

Database types passed on toIOScannot be correctly analyzed

code

// Countdown function execute once a second
setInterval(daojishi,1000);
// The countdown function used EACH to traverse all the time you need to deal with
function daojishi(){
    
    $(".truetime").each(function(){
    
        var end= $(this).html();
        var end_on=formatStr(end);// Solve the problem of incompatibility of iOS mobile phones
        var curtime=new Date();
        var endtime=new Date(end_on);
        var lefttime= parseInt((endtime.getTime()-curtime.getTime())/(1000));
        if (lefttime>0) {
            var day=parseInt(lefttime/(24*60*60));
            var hours=parseInt( (lefttime/(60*60))%24);
            var minutes=parseInt( (lefttime/(60))%60);
            var seconds=parseInt( (lefttime)%60);
            hours  =checkout(hours);
            minutes  =checkout(minutes);
            seconds  =checkout(seconds);
            var title =day+'& nbsp; Sky & nbsp;'+hours+'& nbsp; hours & nbsp;'+minutes+'& nbsp; divided & nbsp;'+seconds+'& nbsp; second & nbsp;';
        }else{
            var title="Time End"
        }
        $(this).next('span').html(title);
    });
};  

The time for the database is 2016-06-08 This time is not compatible with an unfarished time format, so the following functions are used to turn it into 2016/06/08

Solution

function formatStr(str) {
    
    str=str.replace(/-/g,"/");
};

Thinking of the program

In countdown, use

var curtime=new Date();

This function acquisition is not appropriate for the client time. Modify the local current time to grab things! Intersection Intersection Take the system time and then subtract the results, but the corresponding background processing time will affect the accuracy of the countdown! Intersection So what to do to think!

source

Related Posts

C ++ Different from the difference between Iterator and Constitrator and Const Iterator

Section 25 (conversion flow, print flow) Phoebe

IOS Development About Integrated Third -Party SMS Notice

Detailed explanation list list in Python

Android: Canvas Draw self -rotating bitmap

Random Posts

VC MSFLEXGrid Basic use

“Spring Design Thought” 8-Beandefinition BeanClass converted from String to ClassDavid from String to ClassDavid

vue foundation/life cycle/routing

Algorithm computer vision MSER algorithm, please enter

front-end componentization-webpack packaging edit js library, published to NPMASIA