Details

    • Sub-task
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 1.5.0
    • SQL
    • None
    • Spark 1.5 release

    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

          Activity

            People

              adrian-wang Adrian Wang
              rxin Reynold Xin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: