Angular-cli: ng serve doesn't consider the timezone when printing the output

Created on 11 Oct 2018  路  5Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.2.4
Node: 8.12.0
Yarn: 1.10.1
OS: linux x64
Angular: 6.1.10

Repro steps

ng serve

The log given by the failure

As it's seen on the next image, the date on the machine and the date on the ng serve output differ (more precisely, the timezone is not being considered).

screenshot from 2018-10-11 14-42-42

Desired functionality

The log should print the correct local date and time.

devkibuild-angular easy (hours) low good first issue inconvenient

Most helpful comment

Could this decision be revisited?

Why was this intended to work like this?

The log is not shown on a server located in another part of the planet (as ng serve is not intended for use in production, only during development). This log is only seen for the developer working on a local machine, it should't have to calculate another timezone (or get a standard global one, like Z).

I understand that this is just a minor inconvenience, that you just can watch the minutes only to get the reference, but is making long coding sessions more complicated (and for no apparent reason).

All 5 comments

The time is in UTC notice the Z at the end of the time stamp. This is intentional and intended.

Could this decision be revisited?

Why was this intended to work like this?

The log is not shown on a server located in another part of the planet (as ng serve is not intended for use in production, only during development). This log is only seen for the developer working on a local machine, it should't have to calculate another timezone (or get a standard global one, like Z).

I understand that this is just a minor inconvenience, that you just can watch the minutes only to get the reference, but is making long coding sessions more complicated (and for no apparent reason).

For somebody who still wants to override this:
node_modules/@angular-devkit/build-angular/src/angular-cli-files/utilities/stats.js

replace new Date().toISOString() with new Date().toString()

Is there any plan to have this configurable at least for all workspaces?

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings