Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save purplecandy/6c520216663a67df1291006cf28185eb to your computer and use it in GitHub Desktop.

Select an option

Save purplecandy/6c520216663a67df1291006cf28185eb to your computer and use it in GitHub Desktop.
System Info
Mac:
system_profiler SPHardwareDataType | grep "Serial Number" && echo "System (IST): $(TZ=Asia/Kolkata date '+%d-%b-%Y %I:%M:%S %p IST')" && echo "Google (IST): $(TZ=Asia/Kolkata date -r $(date -juf '%a, %d %b %Y %H:%M:%S GMT' "$(curl -sI google.com | sed -n 's/[Dd]ate: //p' | tr -d '\r')" +%s) '+%d-%b-%Y %I:%M:%S %p IST')"
Windows:
wmic bios get serialnumber && powershell -c "echo ('System (IST): '+[TimeZoneInfo]::ConvertTimeBySystemTimeZoneId((Get-Date),'India Standard Time').ToString('dd-MMM-yyyy hh:mm:ss tt IST'));echo ('Google (IST): '+[TimeZoneInfo]::ConvertTimeBySystemTimeZoneId([datetime](Invoke-WebRequest google.com -Method Head -UseBasicParsing).Headers.Date,'India Standard Time').ToString('dd-MMM-yyyy hh:mm:ss tt IST'))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment