pustakakoran

Bash Today, Yesterday, Tomorrow

Nov 29th, 2017
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HARI INI/TODAY:
  2. #get today's date
  3. export TZ=Asia/Jakarta
  4. TAHUNBULAN=$(date --date='0 days' '+%Y%m')
  5. TODAY=$(date --date='0 days' '+%Y%m%d')
  6. TODAYGARIS=$(date --date='0 days' '+%Y-%m-%d')
  7.  
  8. KEMARIN/YESTERDAY:
  9. #get today's date
  10. export TZ=Asia/Jakarta
  11. TAHUNBULAN=$(date --date='-1 days' '+%Y%m')
  12. TODAY=$(date --date='-1 days' '+%Y%m%d')
  13. TODAYGARIS=$(date --date='-1 days' '+%Y-%m-%d')
  14.  
  15. ESOK/TOMORROW:
  16. #get today's date
  17. export TZ=Asia/Jakarta
  18. TAHUNBULAN=$(date --date='1 days' '+%Y%m')
  19. TODAY=$(date --date='1 days' '+%Y%m%d')
  20. TODAYGARIS=$(date --date='1 days' '+%Y-%m-%d')
RAW Paste Data