Returns the current timestamp (UTC) with microsecond precision.
Returns:
| Name | Type | Description |
Expression | Expression | a Timestamp[us] expression containing the current datetime, broadcast to every row. |
Examples:
| >>> import daft
>>> from daft.functions import current_timestamp
>>> df = daft.from_pydict({"x": [1, 2, 3]})
>>> df = df.with_column("now", current_timestamp())
>>> df.schema()["now"].dtype == daft.DataType.timestamp("us")
|
Source code in daft/functions/datetime.py
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388 | def current_timestamp() -> Expression:
"""Returns the current timestamp (UTC) with microsecond precision.
Returns:
Expression: a Timestamp[us] expression containing the current datetime, broadcast to every row.
Examples:
>>> import daft
>>> from daft.functions import current_timestamp
>>> df = daft.from_pydict({"x": [1, 2, 3]})
>>> df = df.with_column("now", current_timestamp())
>>> df.schema()["now"].dtype == daft.DataType.timestamp("us")
True
"""
return Expression._call_builtin_scalar_fn("current_timestamp")
|