Repository: duckdb/duckdb (language: python)

Issue:
current_date & current_time PostgreSQL incompatibility 
### What happens?

I opened a PR to the duckdb docs (https://github.com/duckdb/duckdb-web/pull/4206) stating current incompatibilty in the `current_date` and `current_time` pseudo-columns.

Usually, when duckdb differs from PostgreSQL it's for reasons I support. In this case, I think PostgreSQL's behavior is clearly better, so I wanted to raise this as an issue before it's enshrined into the docs.

DuckDB isn't even consistent within itself! `current_timestamp` returns a `TIMESTAMPTZ` and `current_localtimestamp()` a `TIMESTAMP` -- perfect --, but `current_time` returns a `TIME` while `current_localtime()` correctly returns a `TIME`. Clearly, `current_time` should return a `TIMETZ` like PostgreSQL does.

Also, there is no `current_localdate()` to get the correct local date (and that'd be perfectly fine if `current_date` did what it was supposed to; nobody needs to know the `current_date` in UTC, and if they were sure they absolutely did need to know, they could achieve that by setting their timezone or by using `timezone('UTC', current_timestamp)::DATE`)

### To Reproduce

```sql
SET TimeZone = 'Asia/Novosibirsk';
SELECT current_date, current_time, current_timestamp 
```
```
┌──────────────┬──────────────┬────────────────────────────┐
│ current_date │ current_time │     current_timestamp      │
│     date     │     time     │  timestamp with time zone  │
├──────────────┼──────────────┼────────────────────────────┤
│ 2024-11-30   │ 21:13:31.918 │ 2024-12-01 04:13:31.918+07 │
└──────────────┴──────────────┴────────────────────────────┘
```

### OS:

Linux

### DuckDB Version:

1.1.0

### DuckDB Client:

Python

### Hardware:

i5, AMD64

### Full Name:

Soeren Wolfers

### Affiliation:

G-Research

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

### Did you include all relevant data sets for reproducing the issue?

Not applicable - the reproduction does not require a data set

### Did you include all code required to reproduce the issue?

- [X] Yes, I have

### Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

- [X] Yes, I have


Discussion / hints:

Fix patch:
diff --git a/extension/core_functions/function_list.cpp b/extension/core_functions/function_list.cpp
index 0d7415e8f3f2..9e4598318c36 100644
--- a/extension/core_functions/function_list.cpp
+++ b/extension/core_functions/function_list.cpp
@@ -136,7 +136,6 @@ static const StaticFunctionDefinition core_functions[] = {
 	DUCKDB_AGGREGATE_FUNCTION(CovarPopFun),
 	DUCKDB_AGGREGATE_FUNCTION(CovarSampFun),
 	DUCKDB_SCALAR_FUNCTION(CurrentDatabaseFun),
-	DUCKDB_SCALAR_FUNCTION(CurrentDateFun),
 	DUCKDB_SCALAR_FUNCTION(CurrentQueryFun),
 	DUCKDB_SCALAR_FUNCTION(CurrentSchemaFun),
 	DUCKDB_SCALAR_FUNCTION(CurrentSchemasFun),
@@ -193,7 +192,6 @@ static const StaticFunctionDefinition core_functions[] = {
 	DUCKDB_SCALAR_FUNCTION_ALIAS(GenRandomUuidFun),
 	DUCKDB_SCALAR_FUNCTION_SET(GenerateSeriesFun),
 	DUCKDB_SCALAR_FUNCTION(GetBitFun),
-	DUCKDB_SCALAR_FUNCTION(CurrentTimeFun),
 	DUCKDB_SCALAR_FUNCTION(GetCurrentTimestampFun),
 	DUCKDB_SCALAR_FUNCTION_SET_ALIAS(GradeUpFun),
 	DUCKDB_SCALAR_FUNCTION_SET(GreatestFun),
@@ -369,7 +367,6 @@ static const StaticFunctionDefinition core_functions[] = {
 	DUCKDB_SCALAR_FUNCTION(ToTimestampFun),
 	DUCKDB_SCALAR_FUNCTION(ToWeeksFun),
 	DUCKDB_SCALAR_FUNCTION(ToYearsFun),
-	DUCKDB_SCALAR_FUNCTION_ALIAS(TodayFun),
 	DUCKDB_SCALAR_FUNCTION_ALIAS(TransactionTimestampFun),
 	DUCKDB_SCALAR_FUNCTION(TranslateFun),
 	DUCKDB_SCALAR_FUNCTION_SET(TrimFun),
diff --git a/extension/core_functions/include/core_functions/scalar/date_functions.hpp b/extension/core_functions/include/core_functions/scalar/date_functions.hpp
index c7192d89f29d..35b16f70a43c 100644
--- a/extension/core_functions/include/core_functions/scalar/date_functions.hpp
+++ b/extension/core_functions/include/core_functions/scalar/date_functions.hpp
@@ -33,21 +33,6 @@ struct CenturyFun {
 	static ScalarFunctionSet GetFunctions();
 };
 
-struct CurrentDateFun {
-	static constexpr const char *Name = "current_date";
-	static constexpr const char *Parameters = "";
-	static constexpr const char *Description = "Returns the current date";
-	static constexpr const char *Example = "current_date()";
-
-	static ScalarFunction GetFunction();
-};
-
-struct TodayFun {
-	using ALIAS = CurrentDateFun;
-
-	static constexpr const char *Name = "today";
-};
-
 struct DateDiffFun {
 	static constexpr const char *Name = "date_diff";
 	static constexpr const char *Parameters = "part,startdate,enddate";
@@ -207,15 +192,6 @@ struct EraFun {
 	static ScalarFunctionSet GetFunctions();
 };
 
-struct CurrentTimeFun {
-	static constexpr const char *Name = "get_current_time";
-	static constexpr const char *Parameters = "";
-	static constexpr const char *Description = "Returns the current time";
-	static constexpr const char *Example = "get_current_time()";
-
-	static ScalarFunction GetFunction();
-};
-
 struct GetCurrentTimestampFun {
 	static constexpr const char *Name = "get_current_timestamp";
 	static constexpr const char *Parameters = "";
diff --git a/extension/core_functions/scalar/date/current.cpp b/extension/core_functions/scalar/date/current.cpp
index 0a3055145a14..3d25ee80a0e3 100644
--- a/extension/core_functions/scalar/date/current.cpp
+++ b/extension/core_functions/scalar/date/current.cpp
@@ -13,19 +13,6 @@ static timestamp_t GetTransactionTimestamp(ExpressionState &state) {
 	return MetaTransaction::Get(state.GetContext()).start_timestamp;
 }
 
-static void CurrentTimeFunction(DataChunk &input, ExpressionState &state, Vector &result) {
-	D_ASSERT(input.ColumnCount() == 0);
-	auto val = Value::TIME(Timestamp::GetTime(GetTransactionTimestamp(state)));
-	result.Reference(val);
-}
-
-static void CurrentDateFunction(DataChunk &input, ExpressionState &state, Vector &result) {
-	D_ASSERT(input.ColumnCount() == 0);
-
-	auto val = Value::DATE(Timestamp::GetDate(GetTransactionTimestamp(state)));
-	result.Reference(val);
-}
-
 static void CurrentTimestampFunction(DataChunk &input, ExpressionState &state, Vector &result) {
 	D_ASSERT(input.ColumnCount() == 0);
 	auto ts = GetTransactionTimestamp(state);
@@ -33,18 +20,6 @@ static void CurrentTimestampFunction(DataChunk &input, ExpressionState &state, V
 	result.Reference(val);
 }
 
-ScalarFunction CurrentTimeFun::GetFunction() {
-	ScalarFunction current_time({}, LogicalType::TIME, CurrentTimeFunction);
-	current_time.stability = FunctionStability::CONSISTENT_WITHIN_QUERY;
-	return current_time;
-}
-
-ScalarFunction CurrentDateFun::GetFunction() {
-	ScalarFunction current_date({}, LogicalType::DATE, CurrentDateFunction);
-	current_date.stability = FunctionStability::CONSISTENT_WITHIN_QUERY;
-	return current_date;
-}
-
 ScalarFunction GetCurrentTimestampFun::GetFunction() {
 	ScalarFunction current_timestamp({}, LogicalType::TIMESTAMP_TZ, CurrentTimestampFunction);
 	current_timestamp.stability = FunctionStability::CONSISTENT_WITHIN_QUERY;
diff --git a/extension/core_functions/scalar/date/functions.json b/extension/core_functions/scalar/date/functions.json
index 6da0714bc1ee..1e499ccb6b26 100644
--- a/extension/core_functions/scalar/date/functions.json
+++ b/extension/core_functions/scalar/date/functions.json
@@ -13,13 +13,6 @@
         "example": "century(timestamp '2021-08-03 11:59:44.123456')",
         "type": "scalar_function_set"
     },
-    {
-        "name": "current_date",
-        "description": "Returns the current date",
-        "example": "current_date()",
-        "type": "scalar_function",
-        "aliases": ["today"]
-    },
     {
         "name": "date_diff",
         "parameters": "part,startdate,enddate",
@@ -133,13 +126,6 @@
         "example": "era(timestamp '2021-08-03 11:59:44.123456')",
         "type": "scalar_function_set"
     },
-    {
-        "struct": "CurrentTimeFun",
-        "name": "get_current_time",
-        "description": "Returns the current time",
-        "example": "get_current_time()",
-        "type": "scalar_function"
-    },
     {
         "name": "get_current_timestamp",
         "description": "Returns the current timestamp",
diff --git a/extension/icu/icu-timezone.cpp b/extension/icu/icu-timezone.cpp
index 344dd1e01da9..0aa8828c5d87 100644
--- a/extension/icu/icu-timezone.cpp
+++ b/extension/icu/icu-timezone.cpp
@@ -339,6 +339,68 @@ struct ICUToTimeTZ : public ICUDateFunc {
 		time = Interval::Add(time, {0, 0, offset * Interval::MICROS_PER_SEC}, date);
 		return dtime_tz_t(time, offset);
 	}
+
+	static inline bool ToTimeTZ(icu::Calendar *calendar, timestamp_t instant, dtime_tz_t &result) {
+		if (!ICUIsFinite(instant)) {
+			return false;
+		}
+
+		//	Time in current TZ
+		auto micros = int32_t(SetTime(calendar, instant));
+		const auto hour = ExtractField(calendar, UCAL_HOUR_OF_DAY);
+		const auto minute = ExtractField(calendar, UCAL_MINUTE);
+		const auto second = ExtractField(calendar, UCAL_SECOND);
+		const auto millis = ExtractField(calendar, UCAL_MILLISECOND);
+		micros += millis * int32_t(Interval::MICROS_PER_MSEC);
+		if (!Time::IsValidTime(hour, minute, second, micros)) {
+			return false;
+		}
+		const auto time = Time::FromTime(hour, minute, second, micros);
+
+		//	Offset in current TZ
+		auto offset = ExtractField(calendar, UCAL_ZONE_OFFSET);
+		offset += ExtractField(calendar, UCAL_DST_OFFSET);
+		offset /= Interval::MSECS_PER_SEC;
+
+		result = dtime_tz_t(time, offset);
+		return true;
+	}
+
+	static bool CastToTimeTZ(Vector &source, Vector &result, idx_t count, CastParameters &parameters) {
+		auto &cast_data = parameters.cast_data->Cast<CastData>();
+		auto &info = cast_data.info->Cast<BindData>();
+		CalendarPtr calendar(info.calendar->clone());
+
+		UnaryExecutor::ExecuteWithNulls<timestamp_t, dtime_tz_t>(source, result, count,
+		                                                         [&](timestamp_t input, ValidityMask &mask, idx_t idx) {
+			                                                         dtime_tz_t output;
+			                                                         if (ToTimeTZ(calendar.get(), input, output)) {
+				                                                         return output;
+			                                                         } else {
+				                                                         mask.SetInvalid(idx);
+				                                                         return dtime_tz_t();
+			                                                         }
+		                                                         });
+		return true;
+	}
+
+	static BoundCastInfo BindCastToTimeTZ(BindCastInput &input, const LogicalType &source, const LogicalType &target) {
+		if (!input.context) {
+			throw InternalException("Missing context for TIMESTAMPTZ to TIMETZ cast.");
+		}
+
+		auto cast_data = make_uniq<CastData>(make_uniq<BindData>(*input.context));
+
+		return BoundCastInfo(CastToTimeTZ, std::move(cast_data));
+	}
+
+	static void AddCasts(DatabaseInstance &db) {
+		auto &config = DBConfig::GetConfig(db);
+		auto &casts = config.GetCastFunctions();
+
+		const auto implicit_cost = CastRules::ImplicitCast(LogicalType::TIMESTAMP_TZ, LogicalType::TIME_TZ);
+		casts.RegisterCastFunction(LogicalType::TIMESTAMP_TZ, LogicalType::TIME_TZ, BindCastToTimeTZ, implicit_cost);
+	}
 };
 
 struct ICUTimeZoneFunc : public ICUDateFunc {
@@ -403,6 +465,7 @@ void RegisterICUTimeZoneFunctions(DatabaseInstance &db) {
 	// 	Casts
 	ICUFromNaiveTimestamp::AddCasts(db);
 	ICUToNaiveTimestamp::AddCasts(db);
+	ICUToTimeTZ::AddCasts(db);
 }
 
 } // namespace duckdb
diff --git a/src/catalog/default/default_functions.cpp b/src/catalog/default/default_functions.cpp
index 91d3ba30ab7c..ecffc34f77ca 100644
--- a/src/catalog/default/default_functions.cpp
+++ b/src/catalog/default/default_functions.cpp
@@ -160,6 +160,9 @@ static const DefaultMacro internal_macros[] = {
 
 	// date functions
 	{DEFAULT_SCHEMA, "date_add", {"date", "interval", nullptr}, {{nullptr, nullptr}}, "date + interval"},
+	{DEFAULT_SCHEMA, "current_date", {nullptr}, {{nullptr, nullptr}}, "current_timestamp::DATE"},
+	{DEFAULT_SCHEMA, "today", {nullptr}, {{nullptr, nullptr}}, "current_timestamp::DATE"},
+	{DEFAULT_SCHEMA, "get_current_time", {nullptr}, {{nullptr, nullptr}}, "current_timestamp::TIMETZ"},
 
 	// regexp functions
 	{DEFAULT_SCHEMA, "regexp_split_to_table", {"text", "pattern", nullptr}, {{nullptr, nullptr}}, "unnest(string_split_regex(text, pattern))"},
diff --git a/src/include/duckdb/main/extension_entries.hpp b/src/include/duckdb/main/extension_entries.hpp
index a864165b5efb..e39802466de5 100644
--- a/src/include/duckdb/main/extension_entries.hpp
+++ b/src/include/duckdb/main/extension_entries.hpp
@@ -135,7 +135,6 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
     {"covar_samp", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
     {"create_fts_index", "fts", CatalogType::PRAGMA_FUNCTION_ENTRY},
     {"current_database", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
-    {"current_date", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"current_localtime", "icu", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"current_localtimestamp", "icu", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"current_query", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
@@ -189,7 +188,6 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
     {"gcd", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"gen_random_uuid", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"get_bit", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
-    {"get_current_time", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"get_current_timestamp", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"get_substrait", "substrait", CatalogType::TABLE_FUNCTION_ENTRY},
     {"get_substrait_json", "substrait", CatalogType::TABLE_FUNCTION_ENTRY},
@@ -681,7 +679,6 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
     {"to_timestamp", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"to_weeks", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"to_years", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
-    {"today", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
     {"tpcds", "tpcds", CatalogType::PRAGMA_FUNCTION_ENTRY},
     {"tpcds_answers", "tpcds", CatalogType::TABLE_FUNCTION_ENTRY},
     {"tpcds_queries", "tpcds", CatalogType::TABLE_FUNCTION_ENTRY},


Test patch:
diff --git a/test/optimizer/misc/test_count_and_sum.test b/test/optimizer/misc/test_count_and_sum.test
index 0cb8d5b892db..f276b50f1c23 100644
--- a/test/optimizer/misc/test_count_and_sum.test
+++ b/test/optimizer/misc/test_count_and_sum.test
@@ -23,11 +23,11 @@ INSERT INTO t1(c1) VALUES ('example_value');
 query I nosort result_1
 SELECT COUNT(*)
 FROM v0
-WHERE (CURRENT_DATE, c0) != (CAST(NULL AS TEXT), '0');
+WHERE (CURRENT_TIMESTAMP, c0) != (CAST(NULL AS TEXT), '0');
 ----
 
 
 query I nosort result_1
-SELECT SUM(CASE WHEN (CURRENT_DATE, c0) != (CAST(NULL AS TEXT), '0') THEN 1 ELSE 0 END)
+SELECT SUM(CASE WHEN (CURRENT_TIMESTAMP, c0) != (CAST(NULL AS TEXT), '0') THEN 1 ELSE 0 END)
 FROM v0;
 ----
diff --git a/test/sql/export/export_functions.test b/test/sql/export/export_functions.test
index 61ae2a733510..609cfd0d8b3b 100644
--- a/test/sql/export/export_functions.test
+++ b/test/sql/export/export_functions.test
@@ -2,6 +2,8 @@
 # description: Test export functions
 # group: [export]
 
+require icu
+
 statement ok
 PRAGMA enable_verification
 
@@ -11,7 +13,7 @@ BEGIN TRANSACTION
 statement ok
 CREATE TABLE tbl(
     d DATE DEFAULT CURRENT_DATE,
-    t TIME DEFAULT CURRENT_TIME,
+    t TIME WITH TIME ZONE DEFAULT CURRENT_TIME,
     ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     cur_user VARCHAR DEFAULT CURRENT_USER,
     "user" VARCHAR DEFAULT USER,
diff --git a/test/sql/function/timestamp/current_time.test b/test/sql/function/timestamp/current_time.test
index a5fb906bb76a..08496e387f1e 100644
--- a/test/sql/function/timestamp/current_time.test
+++ b/test/sql/function/timestamp/current_time.test
@@ -2,13 +2,18 @@
 # description: Test current_time/current_date/etc
 # group: [timestamp]
 
+require icu
+
+statement ok
+SET Calendar='gregorian';
+
 statement ok
 SELECT CAST(CURRENT_TIME AS STRING), CAST(CURRENT_DATE AS STRING), CAST(CURRENT_TIMESTAMP AS STRING), CAST(NOW() AS STRING)
 
 query I
 SELECT typeof(CURRENT_TIME);
 ----
-TIME
+TIME WITH TIME ZONE
 
 query I
 SELECT typeof(CURRENT_DATE);
@@ -23,7 +28,7 @@ TIMESTAMP WITH TIME ZONE
 query I
 SELECT typeof(get_current_time());
 ----
-TIME
+TIME WITH TIME ZONE
 
 foreach func today current_date
 
@@ -48,3 +53,17 @@ SELECT CURRENT_TIME AS TIME
 
 statement ok
 SELECT CURRENT_TIME + interval (1) second AS TIME
+
+# No DST, so offset never changes
+statement ok
+SET TimeZone='Pacific/Honolulu';
+
+query I
+select current_timestamp;
+----
+<REGEX>:[-0-9:\. ]+-10
+
+query I
+select current_time;
+----
+<REGEX>:[0-9:\.]+-10
diff --git a/test/sql/parser/test_value_functions.test b/test/sql/parser/test_value_functions.test
index 0e508ee8b79c..c8759497fee2 100644
--- a/test/sql/parser/test_value_functions.test
+++ b/test/sql/parser/test_value_functions.test
@@ -2,6 +2,8 @@
 # description: Test SQL value functions
 # group: [parser]
 
+require no_extension_autoloading
+
 statement ok
 PRAGMA enable_verification
 
diff --git a/test/sql/pivot/pivot_errors.test b/test/sql/pivot/pivot_errors.test
index 04e3ecdae992..c4bcc1d2897c 100644
--- a/test/sql/pivot/pivot_errors.test
+++ b/test/sql/pivot/pivot_errors.test
@@ -17,7 +17,7 @@ statement ok
 SET pivot_filter_threshold=0
 
 statement error
-PIVOT test ON j IN ('a', 'b') USING current_date();
+PIVOT test ON j IN ('a', 'b') USING get_current_timestamp();
 ----
 no aggregates were found
 
@@ -25,7 +25,7 @@ statement ok
 SET pivot_filter_threshold=100
 
 statement error
-PIVOT test ON j IN ('a', 'b') USING current_date();
+PIVOT test ON j IN ('a', 'b') USING get_current_timestamp();
 ----
 no aggregates were found
 
diff --git a/test/sql/sample/reservoir_testing_percentage.test_slow b/test/sql/sample/reservoir_testing_percentage.test_slow
index 80d81537dd84..e14a439f8e79 100644
--- a/test/sql/sample/reservoir_testing_percentage.test_slow
+++ b/test/sql/sample/reservoir_testing_percentage.test_slow
@@ -8,7 +8,7 @@ statement ok
 pragma threads=${i};
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000);
 
 query I
 SELECT count(*) from t1 using sample 0 percent (reservoir);
@@ -36,7 +36,7 @@ SELECT count(*) from t1 using sample 100 percent (reservoir);
 1000
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(10000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(10000);
 
 query I
 select count(*) from t1 using sample 80 percent (reservoir);
@@ -44,7 +44,7 @@ select count(*) from t1 using sample 80 percent (reservoir);
 8000
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000000);
 
 query I
 select count(*) from t1 using sample 20 percent (reservoir);
diff --git a/test/sql/sample/reservoir_testing_rows_value.test_slow b/test/sql/sample/reservoir_testing_rows_value.test_slow
index 3956c126d76b..a4e355a69044 100644
--- a/test/sql/sample/reservoir_testing_rows_value.test_slow
+++ b/test/sql/sample/reservoir_testing_rows_value.test_slow
@@ -8,7 +8,7 @@ statement ok
 pragma threads=${i};
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000);
 
 query I
 SELECT count(*) from t1 using sample 0;
@@ -36,7 +36,7 @@ SELECT count(*) from t1 using sample 1000;
 1000
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(10000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(10000);
 
 query I
 select count(*) from t1 using sample 1000;
@@ -59,7 +59,7 @@ select count(*) from t1 using sample 8000;
 8000
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000000);
 
 query I
 select count(*) from t1 using sample 200000;
diff --git a/test/sql/sample/same_seed_same_sample.test_slow b/test/sql/sample/same_seed_same_sample.test_slow
index 0e6141b9e521..c191fcb75e30 100644
--- a/test/sql/sample/same_seed_same_sample.test_slow
+++ b/test/sql/sample/same_seed_same_sample.test_slow
@@ -5,7 +5,7 @@
 # testing a table with less cardinality than the standard vector size
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000);
 
 loop i 1 8
 
@@ -26,7 +26,7 @@ endloop
 # testing a table with greater cardinality than the standard vector size
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(100000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(100000);
 
 loop i 1 8
 
@@ -45,7 +45,7 @@ SELECT * from t1 using sample reservoir(6000) repeatable (1) order by a;
 endloop
 
 statement ok
-CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_time() c from range(1000000);
+CREATE or replace TABLE t1 as select range a, [1, a, 2] b, a::VARCHAR || 'ducktastic' c, get_current_timestamp() c from range(1000000);
 
 loop i 1 8
 
diff --git a/test/sql/table_function/range_non_foldable.test b/test/sql/table_function/range_non_foldable.test
index 131e5e570b63..73b6aecb0933 100644
--- a/test/sql/table_function/range_non_foldable.test
+++ b/test/sql/table_function/range_non_foldable.test
@@ -2,6 +2,10 @@
 # description: Issue #5546: non-foldable constant parameters to table function
 # group: [table_function]
 
+require no_extension_autoloading
+
+require icu
+
 statement ok
 PRAGMA enable_verification
 
diff --git a/tools/pythonpkg/tests/fast/api/test_native_tz.py b/tools/pythonpkg/tests/fast/api/test_native_tz.py
index df4c7f22c221..013871fb4df7 100644
--- a/tools/pythonpkg/tests/fast/api/test_native_tz.py
+++ b/tools/pythonpkg/tests/fast/api/test_native_tz.py
@@ -73,7 +73,7 @@ def test_arrow_timestamp_time(self, duckdb_cursor):
         duckdb_cursor.execute("SET timezone='America/Los_Angeles';")
         res1 = duckdb_cursor.execute(f"select TimeRecStart::TIMETZ  as tz  from '{filename}'").arrow().to_pandas()
         res2 = duckdb_cursor.execute(f"select TimeRecStart::TIMETZ::TIME  as tz  from '{filename}'").arrow().to_pandas()
-        assert res1['tz'][0].hour == 21 and res1['tz'][0].minute == 52
+        assert res1['tz'][0].hour == 14 and res1['tz'][0].minute == 52
         assert res2['tz'][0].hour == res2['tz'][0].hour and res2['tz'][0].minute == res1['tz'][0].minute
 
         duckdb_cursor.execute("SET timezone='UTC';")