A date is a specific point in time. This point in time will be named differently in different places. When I write this, it is 00:27 on Tuesday in Germany, 23:27 on Monday in the UK and 18:27 on Monday in New York.
To take an example method: getDay returns the day of the week in the local time zone. Right now, for a user in Germany, he will return 2. For a user in the UK or USA, he will return 1. After an hour, he will return 2 for a user in the UK (because then it will be 00: 27 on Tuesday).
The methods..UTC .. refer to the representation of time in UTC (also known as GMT). In winter, this is the same time zone as in the UK; in summer, it lags behind time in the UK.
It is summer when I write this. getUTCDay will return 1 (Monday), getUTCHours will return 22, getUTCMinutes will return 27. So it is 22:27 on Monday in the UTC time zone. While plain get ... functions return different values depending on where the user is located, getUTC .. functions return the same values regardless of where the user is.
Jon bright
source share