-2

i have used daylight time saving check in php using below code

if (date('I', time()))
    {
    $time_zone = 'BST';
    }
    else
    {
    $time_zone = 'GMT';
    }

How can i check same functionality in angular 6

Sandeep Nambiar
  • 1,656
  • 3
  • 22
  • 38
  • Possible duplicate of [How to check if the DST (Daylight Saving Time) is in effect and if it is what's the offset?](https://stackoverflow.com/questions/11887934/how-to-check-if-the-dst-daylight-saving-time-is-in-effect-and-if-it-is-whats) – PeS Sep 26 '18 at 21:57

1 Answers1

2

Angular is not a language. Angular 6 runs with Typescript which transpiles to javascript. You're looking for a js/ts way of doing this which has already been answered.

How to check if the DST (Daylight Saving Time) is in effect and if it is what's the offset?

Eddy Howard
  • 127
  • 11
  • Edit: TS is nearly the same as js except ts uses types. You will need to do the conversion yourself such as.. `var obj = x;` in ts would be `const obj: any = x;` and so on. Pure JS will most likely work as well, your lint will just bark at you. – Eddy Howard Sep 26 '18 at 20:04