Skip to content

Commit c0e353d

Browse files
authored
add unix_timestamp (#312)
1 parent 321eda0 commit c0e353d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

spec/API_specification/dataframe_api/column_object.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,3 +902,24 @@ def iso_weekday(self) -> Self:
902902
"""
903903
...
904904

905+
906+
def unix_timestamp(self, *, time_unit: Literal['s', 'ms', 'us'] = 's') -> Self:
907+
"""
908+
Return the number of seconds (or milliseconds or microseconds) since the Unix epoch.
909+
910+
The Unix epoch is 00:00:00 UTC on 1 January 1970.
911+
912+
Parameters
913+
----------
914+
time_unit
915+
Time unit to use. Must be one of 's', 'ms', or 'us'.
916+
917+
Returns
918+
-------
919+
Column
920+
Integer data type. For example, if the date is 1970-01-02T00:00:00.123456,
921+
and the time_unit is ``'s'``, then the result should be 86400, and not
922+
86400.123456. Information smaller than the given time unit should be
923+
discarded.
924+
"""
925+
...

0 commit comments

Comments
 (0)