<?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 Get first day of week - java routine in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Get-first-day-of-week-java-routine/m-p/2235365#M24426</link>
    <description>Hi! I have a routine to generate week of year. 
&lt;BR /&gt;import java.util.Calendar;
&lt;BR /&gt;import java.util.Date;
&lt;BR /&gt;
&lt;BR /&gt;public class fechas {
&lt;BR /&gt;public static String semana_del_anyo(Date date1) {
&lt;BR /&gt; Calendar c1 = Calendar.getInstance();
&lt;BR /&gt; c1.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
&lt;BR /&gt; c1.setMinimalDaysInFirstWeek(1);
&lt;BR /&gt; c1.setTime(date1);
&lt;BR /&gt; int semana = c1.get(Calendar.WEEK_OF_YEAR);
&lt;BR /&gt; if (semana &amp;lt; 10) {
&lt;BR /&gt; return ( 0 + Integer.toString(semana));
&lt;BR /&gt; } else {
&lt;BR /&gt; return (Integer.toString(semana));
&lt;BR /&gt; }}
&lt;BR /&gt;}
&lt;BR /&gt;Now, I need to set the first day of week as Monday because I suppose that it use the first day as Sunday. How can I include it in this routine?
&lt;BR /&gt;Thank you
&lt;BR /&gt;Regards</description>
    <pubDate>Thu, 11 Oct 2012 20:42:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-10-11T20:42:30Z</dc:date>
    <item>
      <title>Get first day of week - java routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-first-day-of-week-java-routine/m-p/2235365#M24426</link>
      <description>Hi! I have a routine to generate week of year. 
&lt;BR /&gt;import java.util.Calendar;
&lt;BR /&gt;import java.util.Date;
&lt;BR /&gt;
&lt;BR /&gt;public class fechas {
&lt;BR /&gt;public static String semana_del_anyo(Date date1) {
&lt;BR /&gt; Calendar c1 = Calendar.getInstance();
&lt;BR /&gt; c1.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
&lt;BR /&gt; c1.setMinimalDaysInFirstWeek(1);
&lt;BR /&gt; c1.setTime(date1);
&lt;BR /&gt; int semana = c1.get(Calendar.WEEK_OF_YEAR);
&lt;BR /&gt; if (semana &amp;lt; 10) {
&lt;BR /&gt; return ( 0 + Integer.toString(semana));
&lt;BR /&gt; } else {
&lt;BR /&gt; return (Integer.toString(semana));
&lt;BR /&gt; }}
&lt;BR /&gt;}
&lt;BR /&gt;Now, I need to set the first day of week as Monday because I suppose that it use the first day as Sunday. How can I include it in this routine?
&lt;BR /&gt;Thank you
&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 11 Oct 2012 20:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-first-day-of-week-java-routine/m-p/2235365#M24426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-11T20:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get first day of week - java routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-first-day-of-week-java-routine/m-p/2235366#M24427</link>
      <description>Dear user&lt;BR /&gt;The day of week starts with SunDay, if I understand you well, you can minus one day to the current date using the built-in function TalendDate.addDate(Date date, "-1","dd"), and then the get the day of week. For example, call your routine on a tJava component:&lt;BR /&gt;&lt;PRE&gt;java.util.Date currentDate=TalendDate.getCurrentDate();&lt;BR /&gt;String day_of_week=fechas.semana_del_anyo(currentDate);&lt;BR /&gt;System.out.println(day_of_week);&lt;BR /&gt;java.util.Date date1=TalendDate.addDate(currentDate, "-1","dd");&lt;BR /&gt;String day_of_week1=fechas.semana_del_anyo(date1);&lt;BR /&gt;System.out.println(day_of_week1);&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2012 06:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-first-day-of-week-java-routine/m-p/2235366#M24427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T06:36:52Z</dc:date>
    </item>
  </channel>
</rss>

