[ https://issues.apache.org/jira/browse/SPARK-28874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919294#comment-16919294 ]
Hyukjin Kwon commented on SPARK-28874: -------------------------------------- Use {{y}}. {{Y}} is {{Y week-based-year year 1996; 96}}. See https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html > Pyspark date_format add one years in the last days off year > ----------------------------------------------------------- > > Key: SPARK-28874 > URL: https://issues.apache.org/jira/browse/SPARK-28874 > Project: Spark > Issue Type: Bug > Components: PySpark > Affects Versions: 2.1.0, 2.3.0 > Reporter: Luis > Priority: Major > > Pyspark date_format add one years in the last days off year : > Example : > {code:python} > from pyspark.sql.functions import date_format, lit > spark.range(1).select(date_format(lit("2010-12-26"), "YYYY-MM-dd")).show() > {code} > {code} > +-----------------------------------+ > |date_format(2010-12-26, YYYY-MM-dd)| > +-----------------------------------+ > | 2011-12-26| > +-----------------------------------+ > {code} > -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org