pyspark.sql.functions.time_to_micros#
- pyspark.sql.functions.time_to_micros(col)[source]#
Extracts microseconds from TIME value.
New in version 4.2.0.
- Parameters
- col
Columnor column name TIME value to convert.
- col
Examples
>>> from pyspark.sql import functions as sf >>> df = spark.sql("SELECT TIME'14:30:00.5' as time") >>> df.select(sf.time_to_micros('time')).show() +--------------------+ |time_to_micros(time)| +--------------------+ | 52200500000| +--------------------+