티스토리 뷰
728x90
- https://unix.stackexchange.com/questions/374389/formatting-the-date-in-bash/710512#710512
- https://www.vankuik.nl/2019-04-23_ISO_date_on_macOS
Formatting the date in bash
I would like to format the date in bash in a script. The format is: 2016-10-05T12:18:36.890+02:00 I'm currently using: $(date +%Y%m%d%H%M%S) Any idea how this can be done?
unix.stackexchange.com
vankuik.nl: 2019-04-23 ISO date on macOS
To print the current date in ISO 8601 format on macOS: $ date +%Y-%m-%dT%H:%M:%S 2019-04-23T14:44:46 To print it with the timezone information, append %z. $ date +%Y-%m-%dT%H:%M:%S%z 2019-04-23T14:44:42+0200 Note that in the last case, you're missing the c
www.vankuik.nl
zone=$(date +%z)
datetime=$(date +%Y-%m-%dT%H:%M:%S)
iso=$datetime${zone:0:3}:${zone:3:2}
echo $iso
728x90
'공부' 카테고리의 다른 글
[CI] ktlint & detekt (0) | 2022.07.22 |
---|---|
[github] auto-author-assign (0) | 2022.07.22 |
[Presto] DATE_ADD, DATE_DIFF (0) | 2022.07.20 |
[Spring] @ConditionalOnProperty (0) | 2022.07.20 |
Multi-armed Bandit (0) | 2022.07.20 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 테슬라 리퍼럴 코드 생성
- COUNT
- 테슬라 레퍼럴 적용 확인
- 책그림
- 할인
- follower
- 인스타그램
- 테슬라 레퍼럴 코드 확인
- wlw
- 테슬라 리퍼럴 코드 혜택
- 팔로워 수 세기
- 테슬라 크레딧 사용
- 김달
- Bot
- 테슬라
- 레퍼럴
- 메디파크 내과 전문의 의학박사 김영수
- 테슬라 레퍼럴
- 테슬라 추천
- 클루지
- Kluge
- 연애학개론
- 모델y
- 모델 Y 레퍼럴
- 개리마커스
- 유투브
- 어떻게 능력을 보여줄 것인가?
- 테슬라 리퍼럴 코드
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함