<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: System.formatDate() Year 2016 Bug? in VMware Aria Automation Orchestrator Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368585#M10666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not a bug but kind of expected behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your date pattern uses uppercase 'Y' for year. According to spec &lt;A href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"&gt;http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&amp;nbsp; 'Y' is not 'year' but 'week year'. To get the 'year', you need to use lowercase 'y'. Check the following page for what is the difference between year and week year &lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#week_year"&gt;http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#week_year&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix your code, just replace YYYY with yyyy. The pattern should become "yyyy&lt;SPAN style="color: #666666; font-family: proxima-nova, Arial, sans-serif; font-size: 14px;"&gt;-MM-dd HH:mm:ss"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Jan 2016 13:51:47 GMT</pubDate>
    <dc:creator>iiliev</dc:creator>
    <dc:date>2016-01-02T13:51:47Z</dc:date>
    <item>
      <title>System.formatDate() Year 2016 Bug?</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368584#M10665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, can anyone confirm this Happy-New-Year-feature (found on a german windows Server 2k12R2, with vCenter Orchestrator 5.5.3):&lt;/P&gt;&lt;P&gt;- Create a new Workflow&lt;/P&gt;&lt;P&gt;- Add one scriptable Task&lt;/P&gt;&lt;P&gt;Use the following content for the scriptable Task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var myTimestamp = System.getCurrentTime();&lt;/P&gt;&lt;P&gt;var myDate = new Date();&lt;/P&gt;&lt;P&gt;myDate.setTime(myTimestamp);&lt;/P&gt;&lt;P&gt;System.log("getYear from DateObject: "+(myDate.getYear()+1900));&lt;/P&gt;&lt;P&gt;System.log(System.formatDate(myDate, "YYYY-MM-dd HH:mm:ss"));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run the workflow.&lt;/P&gt;&lt;P&gt;I would exspect in the log lines:&lt;/P&gt;&lt;P&gt;2016&lt;/P&gt;&lt;P&gt;2016-01-02 13:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I get: &lt;/P&gt;&lt;P&gt;2016&lt;/P&gt;&lt;P&gt;2015-01-02 13:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The clock on the server is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A SR is already open but I'm interested if its only on "my" server or on other servers, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jan 2016 12:45:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368584#M10665</guid>
      <dc:creator>Kagome</dc:creator>
      <dc:date>2016-01-02T12:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: System.formatDate() Year 2016 Bug?</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368585#M10666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not a bug but kind of expected behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your date pattern uses uppercase 'Y' for year. According to spec &lt;A href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"&gt;http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&amp;nbsp; 'Y' is not 'year' but 'week year'. To get the 'year', you need to use lowercase 'y'. Check the following page for what is the difference between year and week year &lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#week_year"&gt;http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#week_year&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix your code, just replace YYYY with yyyy. The pattern should become "yyyy&lt;SPAN style="color: #666666; font-family: proxima-nova, Arial, sans-serif; font-size: 14px;"&gt;-MM-dd HH:mm:ss"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jan 2016 13:51:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368585#M10666</guid>
      <dc:creator>iiliev</dc:creator>
      <dc:date>2016-01-02T13:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: System.formatDate() Year 2016 Bug?</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368586#M10667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;&lt;P&gt;I never heard of "week of year" before ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jan 2016 14:05:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/System-formatDate-Year-2016-Bug/m-p/1368586#M10667</guid>
      <dc:creator>Kagome</dc:creator>
      <dc:date>2016-01-02T14:05:08Z</dc:date>
    </item>
  </channel>
</rss>

