shiroi blog

This is my blog...

js显示自定义时间

<!DOCTYPE html>
<html>
    <head>
    <meta charset="UTF-8">
    <title>Show Time Page</title>
    </head>
    <body>
    
        <a id="time"></a><a id="bjtime"></a>
        
        <script type="text/javascript">
            /*
              进入页面加载的方法
            */
            window.onload=function()
            {
                 var date=new Date(),time=date.getTime();
                 setInterval(function() {set(time);time = Number(time);time += 1000;},1000);
                 setTodayDate(date);
            }
          
          /*
           设置日期的方法,针对年月日星期的显示
          */
          function setTodayDate(today)
          {
              var years,months,dates,weeks, intYears,intMonths,intDates,intWeeks,today,timeString,mon;
              
              intYears = today.getFullYear();//获得年
              intMonths = today.getMonth() + 1;//获得月份+1
              intDates = today.getDate();//获得天数
              intWeeks = today.getDay();//获得星期
              
              years = intYears + '.     ';
              switch(intMonths)
              {
                  case 1:
                      mon = 'JANUARY';
                  break;
                  case 2:
                      mon = 'FEBRUARY';
                  break;
                  case 3:
                      mon = 'MARCH';
                  break;
                  case 4:
                      mon = 'APRIL';
                  break;
                  case 5:
                      mon = 'MAY';
                  break;
                  case 6:
                      mon = 'JUNE';
                  break;
                  case 7:
                      mon = 'JULY';
                  break;
                  case 8:
                      mon = 'AUGUST';
                  break;
                  case 9:
                      mon = 'SEPTEMBER';
                  break;
                  case 10:
                      mon = 'OCTOBER';
                  break;
                  case 11:
                      mon = 'NOVEMBER';
                  break;
                  case 12:
                      mon = 'DECEMBER';
                  break;
              }
              /*if(intMonths < 10){
                  months = '0' + intMonths + '月';
              }else{
                  months = intMonths + '月';
              }*/

              
              if(intDates < 10){
                  dates = '0' + intDates + ',   ';
              }else{
                  dates = intDates + ',     ';
              }
              
              var weekArray = new Array(7);
              weekArray[0] = 'SUNDAY';
              weekArray[1] = 'MONDAY';
              weekArray[2] = 'TUESDAY';
              weekArray[3] = 'WEDNESDAY';
              weekArray[4] = 'THURSDAY';
              weekArray[5] = 'FRIDAY';
              weekArray[6] = 'SUNDAY';
              weeks =weekArray[intWeeks] + ' ';
    
              timeString = 'SHIROI,  ' + weeks+", " + mon + ", " + dates  + years;
              
              document.getElementById('time').innerHTML=timeString;
           }
    
         /*
           设置北京时间的方法,针对时分秒的显示
         */
         function set(time)
         {
             var beijingTimeZone = 8;
             var timeOffset = ((-1 * (new Date()).getTimezoneOffset()) - (beijingTimeZone * 60)) * 60000;
             var now = new Date(time - timeOffset);
             document.getElementById('bjtime').innerHTML = p(now.getHours())+':'+p(now.getMinutes())+':'+p(now.getSeconds());
         }
         
         /*
           格式化时间的显示方式
         */
         function p(s) 
         {
            return s < 10 ? '0' + s : s;
         }
    
         </script>
    </body>
</html>

laravel-nginx 配置隐藏index.php

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;
root "D:/phpStudy/WWW/m.idaipai.com/public";
location / {
index index.html index.htm index.php l.php;
autoindex on;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}

}

laravel闭包用法

DB::table('vods')->where('id', "=", $value->id)->where(function ($query) use ($keyword) {
    $query->where('dd_str', '<', mb_strlen($data))->orWhere('dd_str', '=', null);
    })->update([
        'dd' => $data,
        'dd_str' => mb_strlen($data)
]);    

配置nginx,将代码直接显示成页面

server {
    listen 10086;
    server_name _;
        #charset utf-8;
    root /home/wwwroot/default/sso_login;
    index index.html index.php;
    location ~ .*/.(css|js)$ {
     add_header Cache-Control 'no-store';
    }

    location /backend/ {
        proxy_pass http://127.0.0.1:10086/;
        proxy_set_header X-real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
}

composer安装时要求输入授权用户名密码

改用社区的源就好了

composer config -g repo.packagist composer https://packagist.laravel-china.org

请输入图片描述

备案号:粤ICP备18155514号-2