Skip to content

Instantly share code, notes, and snippets.

@thefury
Created February 28, 2021 18:18
Show Gist options
  • Select an option

  • Save thefury/75c9b76133be888791a1c3b220cda534 to your computer and use it in GitHub Desktop.

Select an option

Save thefury/75c9b76133be888791a1c3b220cda534 to your computer and use it in GitHub Desktop.
Convert an arbitrary local date to UTC.
#!/usr/bin/env bash
# Convert an arbitrary date in the format of "YYY-MM-DD HH:MM" from
# local time to UTC.
date -u --date=@$(date "+%s" --date="2021-02-28 03:06")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment