8668: Use more cross-platform utc `date` argument r=matklad a=SomeoneToIgnore

Part of https://github.com/rust-analyzer/rust-analyzer/issues/8571

```
$ docker run -it --rm ubuntu:20.04 bash
root@7393d1e7bbad:/# date -u +%Y-%m-%d
2021-04-26
```

```
$ date -u +%Y-%m-%d
2021-04-26

$ uname -a
Darwin alaptop.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
```

Some of the places where I've change this do not really require it (since macos bin would have failed with `--iso` param also), but I've changed them for consistency.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
bors[bot] 2021-04-26 14:17:05 +00:00 committed by GitHub
commit 6cd669e880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ jobs:
with:
node-version: 12.x
- run: echo "TAG=$(date --iso --utc)" >> $GITHUB_ENV
- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
if: github.ref == 'refs/heads/release'
- run: echo "TAG=nightly" >> $GITHUB_ENV
if: github.ref != 'refs/heads/release'

View File

@ -55,7 +55,7 @@ fn commit_hash() -> Option<String> {
}
fn build_date() -> Option<String> {
output_to_string("date --utc +%Y-%m-%d")
output_to_string("date -u +%Y-%m-%d")
}
fn output_to_string(command: &str) -> Option<String> {

View File

@ -108,7 +108,7 @@ fn run_fuzzer() -> Result<()> {
}
fn date_iso() -> Result<String> {
let res = cmd!("date --utc +%Y-%m-%d").read()?;
let res = cmd!("date -u +%Y-%m-%d").read()?;
Ok(res)
}