Sonu
Sonu

Reputation: 77

yyyy-MM-dd HH24:mm:ss timeStamp using Spark SQL

Is there is any equivalant function to convert this kind of SQL timestamp using spark sql.

    TO_CHAR(SYSTIMESTAMP, "yyyy-MM-dd HH24:mm:ss)

    TO_CHAR(SYSTIMESTAMP, "yyyyMMddHHmmss)

Upvotes: 1

Views: 2167

Answers (1)

过过招
过过招

Reputation: 4224

You can try:

select date_format(current_timestamp(), "yyyy-MM-dd HH:mm:ss");
select date_format(current_timestamp(), "yyyyMMddHHmmss");

Upvotes: 3

Related Questions