Seeing an issue where the output of FORMATDATETIME appears to be incorrect for a particular value:
SET @date = '2019-03-10 02:00:00'; SELECT FORMATDATETIME(@date, 'yyyy-MM-dd HH:mm:ss'), YEAR(@date), MONTH(@date), DAY(@date), HOUR(@date); FORMATDATETIME(@DATE, 'yyyy-MM-dd HH:mm:ss') <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> YEAR(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> MONTH(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> DAY(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> HOUR(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> 2019-03-10 03:00:00 2019 3 10 2 The hour is being output as "03" instead of the expected value of "02". I'm running FORMATDATETIME for every hour of the year 2019, and only see this issue happening for one specific date in 2019 as far as I can tell: 2019-03-10 02:00:00. I also tried for the year 2020, and a different date produces the incorrect output: SET @date = '2020-03-08 02:00:00'; SELECT FORMATDATETIME(@date, 'yyyy-MM-dd HH:mm:ss'), YEAR(@date), MONTH(@date), DAY(@date), HOUR(@date); FORMATDATETIME(@DATE, 'yyyy-MM-dd HH:mm:ss') <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> YEAR(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> MONTH(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> DAY(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> HOUR(@DATE) <http://localhost:8090/h2-console/query.do?jsessionid=65cf12677c92562984b321b35263060d#> 2020-03-08 03:00:00 2020 3 8 2 I am running version 1.4.197 (also tried on 1.4.199). -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/5e1e0193-3cb4-45a4-9394-5498a0da04c7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
