Skip to content

Instantly share code, notes, and snippets.

@erkobridee
Last active August 27, 2025 05:50
Show Gist options
  • Save erkobridee/363f3c35e0b69943c5b77146c1ebf596 to your computer and use it in GitHub Desktop.
Save erkobridee/363f3c35e0b69943c5b77146c1ebf596 to your computer and use it in GitHub Desktop.

Daylight Saving Time

What Is Daylight Savings Time (DST)? - About 40% of countries use Daylight Saving Time. Learn how it works, what makes it controversial, and why it’s not actually saving any daylight.

Central European Time

Central European Time – CET Time Zone

Central European Summer Time – CEST Time Zone

Central European Summer Time (CEST) starts and ends each year as follows:

Start: CEST begins on the last Sunday in March at 02:00 CET, when clocks are set forward one hour to 03:00 CEST.

End: CEST ends on the last Sunday in October at 03:00 CEST, when clocks are set back one hour to 02:00 CET.

source: When exactly do CEST start and end each year | Perplexity.ai

/*
  Day.js - format
    https://day.js.org/docs/en/display/format
*/

const getCestDates = (targetYear = new Date().getFullYear()) => {
  const getLastSundayOfMonth = (dayjsDate) => dayjsDate.endOf('month').day(0)

  const yearDate = dayjs().year(targetYear);
  
  const cestStart = getLastSundayOfMonth(yearDate.month(2)).set('hour', 1);
  const cestEnd = getLastSundayOfMonth(yearDate.month(9)).set('hour', 2);
  
  return [cestStart, cestEnd];
}

const FORMAT = 'YYYY-MM-DD HH:mm:ss ZZ';

const [cestStart, cestEnd] = getCestDates(2025);

console.log(
  'Clock Changes in Central European\n',
  `\tstarts after: ${cestStart.format(FORMAT)}\n`,
  `\tends after: ${cestEnd.format(FORMAT)}`
);

/*
output:

Clock Changes in Central European
 	starts after: 2025-03-30 01:59:59 +0100
 	ends after: 2025-10-26 02:59:59 +0200

*/


//----------------------------------------------------------------------------//

/*
  Dayjs - Timezone
    https://day.js.org/docs/en/plugin/timezone
*/

console.log(
  dayjs('2025-08-26 06:00:00 +0300')
    .tz('Europe/Luxembourg')
    .format('YYYY-MM-DD HH:mm:ss ZZ')
);

/*
  output sample:
    2025-08-26 05:00:00 +0200
*/

Luxembourg

Daylight Saving Time Changes in Luxembourg

Year Calendar – Luxembourg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment