You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2019/08/30 07:39:00 UTC

[jira] [Commented] (SPARK-28874) Pyspark date_format add one years in the last days off year

    [ 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org