cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the time zone in notebook ,

User16826994223
Honored Contributor III

How to change the time zone in notebook ,

1 REPLY 1

User16826994223
Honored Contributor III
  1.  import java.util.TimeZone

 spark.conf.set("spark.sql.session.timeZone", "Asia/Calcutta")

TimeZone.setDefault(TimeZone.getTimeZone("Asia/Calcutta"))

Scala

import java.time

val s: String = time.LocalDateTime.now().toString

println(s)

sql 

%sql

select current_timestamp