import java.time._ import java.util.Date import java.text.SimpleDateFormat import java.util.Locale import java.util.SimpleTimeZone
object CalendarDemo extends App { println("Calendar Demo") val pattern =3D "EEEEE dd MMMMM yyyy HH:mm:ss.SSSZ"; val simpleDateFormat =3D (new SimpleDateFormat(pattern, new Locale("en"= , "UK"))); val date =3D simpleDateFormat.format(new Date()); System.out.println(date); val pattern2 =3D "dd yyyy MM HH:mm:ss.SSSSSSSSSZ"; val simpleDateFormat2 =3D (new SimpleDateFormat(pattern2, new Locale("en", "UK"))); val date2 =3D simpleDateFormat2.format(new Date()); On Tue, 28 Apr 2020, 19:18 Edgardo Szrajber, <szraj...@yahoo.com.invalid> wrote: > Hi > please check combining unix_timestamp and from_unixtime, > Something like: > from_unixtime(unix_timestamp( "06-04-2020 12:03:43"),"yyyy-MM-dd'T'HH:mm:ss > Z") > > please note that I just wrote without any validation. > > In any case, you might want to check the documentation of both functions > to check all valid formats. Also note that this functions are universal > (not only in Spark, Hive) so you have a huge amount of documentation > available. > > Bentzi > > > On Tuesday, April 28, 2020, 08:32:18 PM GMT+3, Mich Talebzadeh < > mich.talebza...@gmail.com> wrote: > > > Unfortunately that did not work. > > any other suggestions? > > thanks > > Dr Mich Talebzadeh > > > > LinkedIn * > https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>* > > > > http://talebzadehmich.wordpress.com > > > *Disclaimer:* Use it at your own risk. Any and all responsibility for any > loss, damage or destruction of data or any other property which may arise > from relying on this email's technical content is explicitly disclaimed. > The author will in no case be liable for any monetary damages arising from > such loss, damage or destruction. > > > > > On Tue, 28 Apr 2020 at 17:41, Mich Talebzadeh <mich.talebza...@gmail.com> > wrote: > > Thanks Neeraj, I'll check it out. ! > > Dr Mich Talebzadeh > > > > LinkedIn * > https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>* > > > > http://talebzadehmich.wordpress.com > > > *Disclaimer:* Use it at your own risk. Any and all responsibility for any > loss, damage or destruction of data or any other property which may arise > from relying on this email's technical content is explicitly disclaimed. > The author will in no case be liable for any monetary damages arising from > such loss, damage or destruction. > > > > > On Tue, 28 Apr 2020 at 17:26, neeraj bhadani <bhadani.neeraj...@gmail.com> > wrote: > > Hi Mich, > You can try Spark DateTime function here and see if that helps. > > > https://medium.com/expedia-group-tech/deep-dive-into-apache-spark-datetime-functions-b66de737950a > > Regards, > Neeraj > > On Tue, Apr 28, 2020 at 5:15 PM Mich Talebzadeh <mich.talebza...@gmail.com> > wrote: > > Hi, > > I have a date in format like 06/04/2020 12:03:43 and we want it to be > displayed as follows: > > yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSZ format > > So the input date is GMT date time just we do not receive the > information with it > > The output should have timezone information > > > Appreciate any ideas. > > > Thanks, > > > Dr Mich Talebzadeh > > > > LinkedIn * > https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>* > > > > http://talebzadehmich.wordpress.com > > > *Disclaimer:* Use it at your own risk. Any and all responsibility for any > loss, damage or destruction of data or any other property which may arise > from relying on this email's technical content is explicitly disclaimed. > The author will in no case be liable for any monetary damages arising from > such loss, damage or destruction. > > > >