Details
Description
3 variants:
unix_timestamp(): long Gets current Unix timestamp in seconds. unix_timestamp(string|date): long Converts time string in format yyyy-MM-dd HH:mm:ss to Unix timestamp (in seconds), using the default timezone and the default locale, return 0 if fail: unix_timestamp('2009-03-20 11:30:01') = 1237573801 unix_timestamp(string date, string pattern): long Convert time string with given pattern (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html]) to Unix time stamp (in seconds), return 0 if fail: unix_timestamp('2009-03-20', 'yyyy-MM-dd') = 1237532400.
See: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF
Attachments
Issue Links
- is duplicated by
-
SPARK-9374 unix_timestamp throws AnalysisException
- Closed
- relates to
-
SPARK-8864 Date/time function and data type design
- Resolved
- links to