![안드로이드 셸에서 유닉스 타임스탬프를 날짜로 변환](https://linux55.com/image/105781/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C%20%EC%85%B8%EC%97%90%EC%84%9C%20%EC%9C%A0%EB%8B%89%EC%8A%A4%20%ED%83%80%EC%9E%84%EC%8A%A4%ED%83%AC%ED%94%84%EB%A5%BC%20%EB%82%A0%EC%A7%9C%EB%A1%9C%20%EB%B3%80%ED%99%98.png)
다음과 같이 Android 셸(Tasker)에서 Debian 타임스탬프를 날짜로 변환하려고 합니다.
날짜-d @1487411077
그런데 일부 오류가 발생했습니다.
어떻게 하나요?
Tasker 오류는 다음과 같습니다.
12.32.45/Variables doreplresult: |sh date -d @%last| -> |sh date -d @1487411077
|
12.32.45/Variables doreplresult: |sh date -d @%last| -> |sh date -d @1487411077
|
12.32.45/E Shell Ausführen: %last -> %last
12.32.45/E Shell Ausführen: ->
12.32.45/E Shell Ausführen: ->
12.32.45/Shell runBackground sh date -d @1487411077
root: true timeout: -1
12.32.45/Shell start process-thread ID 1013
12.32.45/E add wait type Shell1 time 2147483647
12.32.45/E add wait type Shell1 done
12.32.45/E add wait task
12.32.45/Variables doreplresult: |%last| -> |%last|
12.32.45/E Fehler: 127
편집하다:
Android 날짜는 busybox이므로 사용해야 합니다.busybox date -d @1487411077
답변1
Android date
와 마찬가지로 busybox
date
다음을 수행할 수 있어야 합니다.
date -D%s -d 1487411077
-D
2006년에 추가되었고, -d@<epoch>
2010년에 GNU 지원이 추가되었습니다.