Bash 10진수를 2진수로 변환
dectobin () { num=$1 rem=1 bno="" while [ $num -gt 0 ] do rem=`expr $num % 2` bno=$bno$rem num=`expr $num / 2` done i=`echo ${#bno}` final="" while [ $i -gt 0 ] do i=$(( $i - 1 )) rev=`echo ${bno:$i:1}` final=$final$rev done final=`printf "%08d" $final` echo $final }
프로그래밍
2020. 3. 6. 22:50
Python 시간 변환
>>> import time >>> from datetime import datetime >>> time.time() 1345556352.4712839 >>> time.localtime() (2012, 8, 21, 22, 39, 12, 1, 234, 0) >>> time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) '2012-08-21 22:39:12' >>> int(time.mktime(datetime(2012, 8, 21, 22, 34, 34).timetuple())) 1345556074 >>> datetime(*time.strptime("2012-08-21 22:34:34", "%Y-%m-%d %H:%M:%S")[0:6]) datetime..
프로그래밍
2020. 3. 6. 21:59
warpmemory
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
페이지
TAG
- Module
- Ansible
- command
- check
- client
- code
- Python
- 번역
- engineering
- monitoring
- 이슈처리
- 코드
- 명령어
- MariaDB
- Windows
- configuration
- 외부링크
- deview
- Web
- httpd
- File
- mysql
- apache
- error
- Linux
- 예제
- example
- PowerShell
- RESTful
- limits
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함