| #!/bin/bash |
| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| ### set the clock on target using host clock |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/vars.sh || exit $? |
| |
| if [[ "$(uname -s)" = "Darwin" ]]; then |
| device_date=`date +%Y-%m-%dT%T` |
| else |
| device_date=`date -Iseconds` |
| fi |
| |
| echo "Setting device's clock to ${device_date}" |
| fx-command-run shell "clock --set ${device_date}" |