CSS3 digital clock code with day of the week date
js code
<script type="text/javascript" src="js/vue.min.js"></script> <script> var clock = new Vue({ el: '#clock', data: { time: '', date: '' } }); var week = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; var timerID = setInterval(updateTime, 1000); updateTime(); function updateTime() { var cd = new Date(); clock.time = zeroPadding(cd.getHours(), 2) + ':' + zeroPadding(cd.getMinutes(), 2) + ':' + zeroPadding(cd.getSeconds(), 2); clock.date = zeroPadding(cd.getFullYear(), 4) + '-' + zeroPadding(cd.getMonth()+1, 2) + '-' + zeroPadding(cd.getDate(), 2) + ' ' + week[cd.getDay()]; }; function zeroPadding(num, digit) { var zero = ''; for(var i = 0; i < digit; i++) { zero += '0'; } return (zero + num).slice(-digit); }</script>
这是一款非常简单的vue.js实现的带有星期日期的本地时间数字时钟代码。
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
![Animated loading effects implemented in pure css3_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
Animation loading special effects implemented in pure css3
![A batch of hover effects implemented by CSS3_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
A batch of hover special effects implemented by CSS3
![CSS3 mouse slides over animated line border special effects](http://hovertree.com/hvtimg/bjafjg/dc6vc0fh.png)
06 Jul 2016
CSS3 mouse slides over animated line border special effects
![Based on css3 cool page loading animation special effects code_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
Based on css3 cool page loading animation special effects code
![CSS3 elastic stacking image switching special effect suitable for mobile_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
CSS3 elastic stacking image switching special effects suitable for mobile
![Based on jQ CSS3 page scrolling content element animation special effects_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
Based on jQ CSS3 page scrolling content element animation special effects
![CSS3 mobile side sliding menu 4 sliding menu effects_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
CSS3 mobile side sliding menu 4 kinds of sliding menu special effects
![CSS3 practical development: Baidu news hot search word special effects practical development_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
CSS3 practical development: Baidu news hot search word special effects practical development
![9 kinds of cool CSS3 pictures to expand preview and display animated special effects_html/css_WEB-ITnose](/static/imghw/default1.png)
24 Jun 2016
9 types of cool CSS3 images with expanded previews and animated special effects
![See all articles](/static/imghw/down_right.png)
![](/static/imghw/default1.png)
Hot Tools
![CSS text is combined into a heart-shaped animation special effect](https://img.php.cn/upload/jscode/000/000/001/5a41aee69fa64854.png)
CSS text is combined into a heart-shaped animation special effect
CSS text is combined into a heart-shaped animation special effect
![CSS3 SVG expression flower animation special effects](https://img.php.cn/upload/jscode/000/000/001/58d8cebcc2691208.jpg)
CSS3 SVG expression flower animation special effects
SS3 SVG confession flower animation special effect is a Valentine's Day animation special effect.
![CSS shopping mall websites commonly use left category drop-down navigation menu code](https://img.php.cn/upload/jscode/000/000/001/5a3db819dcdbc612.png)
CSS shopping mall websites commonly use left category drop-down navigation menu code
CSS shopping mall websites commonly use left category drop-down navigation menu code
![jQuery+CSS3 Valentine's Day love special effects](https://img.php.cn/upload/jscode/000/000/001/58d8d3ea886c2698.jpg)
jQuery+CSS3 Valentine's Day love special effects
jQuery+CSS3 Valentine's Day Love Special Effect is a Valentine's Day hanging swinging heart animation special effect.
![css3 spoon scooping up glutinous rice balls animation special effects](https://img.php.cn/upload/jscode/000/287/557/6209ad3adc2fc558.png)
css3 spoon scooping up glutinous rice balls animation special effects
A bowl of cute glutinous rice balls expression, a spoon scooping up a glutinous rice balls animation special effects
![](/static/imghw/default1.png)