Returns the current date (UTC).
Returns:
| Name | Type | Description |
Expression | Expression | a Date expression containing today's date, broadcast to every row. |
Examples:
| >>> import daft
>>> from daft.functions import current_date
>>> df = daft.from_pydict({"x": [1, 2, 3]})
>>> df = df.with_column("today", current_date())
>>> df.schema()["today"].dtype == daft.DataType.date()
|
Source code in daft/functions/datetime.py
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371 | def current_date() -> Expression:
"""Returns the current date (UTC).
Returns:
Expression: a Date expression containing today's date, broadcast to every row.
Examples:
>>> import daft
>>> from daft.functions import current_date
>>> df = daft.from_pydict({"x": [1, 2, 3]})
>>> df = df.with_column("today", current_date())
>>> df.schema()["today"].dtype == daft.DataType.date()
True
"""
return Expression._call_builtin_scalar_fn("current_date")
|