pyspark.sql.functions.current_date¶
-
pyspark.sql.functions.
current_date
() → pyspark.sql.column.Column[source]¶ Returns the current date at the start of query evaluation as a
DateType
column. All calls of current_date within the same query return the same value.New in version 1.5.0.
Changed in version 3.4.0: Supports Spark Connect.
- Returns
Column
current date.
Examples
>>> df = spark.range(1) >>> df.select(current_date()).show() +--------------+ |current_date()| +--------------+ | 2022-08-26| +--------------+