
Specialist III
2010-02-03
11:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[resolved] UnParseable Date format
Can someone get me right date format pattern for the below date style. I get this format in my XML feed and find a right pattern.
"2013-09-26T00:00:00-05:00"
"2014-09-26T00:00:00-05:00"
"2015-09-26T00:00:00-05:00"
Thanks
"2013-09-26T00:00:00-05:00"
"2014-09-26T00:00:00-05:00"
"2015-09-26T00:00:00-05:00"
Thanks
934 Views
- « Previous Replies
-
- 1
- 2
- Next Replies »
1 Solution
Accepted Solutions

Anonymous
Not applicable
2014-10-07
07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone get me right date format pattern for the below date style. I get this format in my XML feed and find a right pattern.
"2013-09-26T00:00:00-05:00"
"2014-09-26T00:00:00-05:00"
"2015-09-26T00:00:00-05:00"
Thanks
I use pattern "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" for XML date with miliseconds and timezone, without miliseconds it should be "yyyy-MM-dd'T'HH:mm:ssXXX"
934 Views
15 Replies

Specialist III
2010-02-03
01:15 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any suggestions would be really helpful. I tried few possibilities and all throws up errors.
708 Views

Contributor
2010-02-03
02:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
San Solai,
The date format is the following: yyyy-MM-ddThh:mm:ssz
Most probably it is a GMT time zone.
Hour could be different, it might be HH for example, so you need to check your specifications.
More information can be found in this link: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
The date format is the following: yyyy-MM-ddThh:mm:ssz
Most probably it is a GMT time zone.
Hour could be different, it might be HH for example, so you need to check your specifications.
More information can be found in this link: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
708 Views

Specialist III
2010-02-03
04:04 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried that option it doesn't work. I used this "yyyy-MM-dd'T'hh:mm:ssz" (you need single quotes for 'T'), but throws
Unparseable date: "2006-12-29T00:00:00-06:00" I think the timezone is the culprit, the date format I have does not specify any timezone like "GMT" or others.
The document says, "z" can be applied to
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800
Unparseable date: "2006-12-29T00:00:00-06:00" I think the timezone is the culprit, the date format I have does not specify any timezone like "GMT" or others.
The document says, "z" can be applied to
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800
708 Views

Specialist III
2010-02-03
04:47 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I finally got this to working using Java, by adding the TimeZone(GMT) string to the date string and then apply the date conversion.
Thanks
Thanks
708 Views

Anonymous
Not applicable
2010-02-25
01:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I tried converting the values from StringToDate with the following code in order to convert values from String format say example 2009-04-26T00:00:00-05:00 GMT to Date through Talend. I have very little work experience in Java.
I used the following code in tMap expression to convert the values from String to specify Date format "yyyy-MM-dd'T'hh:mm:ss z"
Code:
-------
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss z");
try
{
Date today = df.parse(row1.Date_TimeZone);
System.out.println(df.format(today));
} catch (ParseException e)
{
e.printStackTrace();
}
It throws an error as DateFormat cannot be resolved
My source is a flatfile which holds the data and my target is a relational table.
Any input is appreciated
Thanks in Advance
Naju
I tried converting the values from StringToDate with the following code in order to convert values from String format say example 2009-04-26T00:00:00-05:00 GMT to Date through Talend. I have very little work experience in Java.
I used the following code in tMap expression to convert the values from String to specify Date format "yyyy-MM-dd'T'hh:mm:ss z"
Code:
-------
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss z");
try
{
Date today = df.parse(row1.Date_TimeZone);
System.out.println(df.format(today));
} catch (ParseException e)
{
e.printStackTrace();
}
It throws an error as DateFormat cannot be resolved
My source is a flatfile which holds the data and my target is a relational table.
Any input is appreciated
Thanks in Advance
Naju
708 Views

Anonymous
Not applicable
2010-02-25
12:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Naju,
You don't need to use the SimpleDateFormat class. You can use the embedded TalendDate class for that:
Regards,
Rabih Dagher
You don't need to use the SimpleDateFormat class. You can use the embedded TalendDate class for that:
try
{
Date today = TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone);
//for testing purposes
System.out.println(today.toString());
} catch (ParseException e)
{
e.printStackTrace();
}
Regards,
Rabih Dagher
708 Views

Anonymous
Not applicable
2010-02-26
12:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rabih,
Thanks for your valuable response
When I substituted my with yours code.
TALEND GENERATED CODE:
Var.TimeZone = try
{
Date today = TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone);
System.out.println(today.toString());
}catch (ParseException e)
{
e.printStackTrace();
It's throwing me the following error
ERROR:
syntax error on token(s) misplaced construct(s).
I tried to find out the answers for this error in many blogs but it really did not help me
Thanks
Naju
Thanks for your valuable response
When I substituted my with yours code.
TALEND GENERATED CODE:
Var.TimeZone = try
{
Date today = TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone);
System.out.println(today.toString());
}catch (ParseException e)
{
e.printStackTrace();
It's throwing me the following error
ERROR:
syntax error on token(s) misplaced construct(s).
I tried to find out the answers for this error in many blogs but it really did not help me
Thanks
Naju
708 Views

Anonymous
Not applicable
2010-02-26
11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Naju,
Can you post some pictures of your job?
If you are doing it in a tMap, I would suggest you do it without the try/catch statement, and use directly the statement TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone);
Where exactly in your code you are doing this?
Can you post some pictures of your job?
If you are doing it in a tMap, I would suggest you do it without the try/catch statement, and use directly the statement TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone);
Where exactly in your code you are doing this?
708 Views

Anonymous
Not applicable
2010-03-01
04:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rdagher,
I handled that expression in tMap component. I also changed the code by removing try and catch exception retaining TalendDate.parseDate function.
"TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone); "
Please see the screenshots.
Thanks for the reply. Hoping for a solution
Regards
Naju
I handled that expression in tMap component. I also changed the code by removing try and catch exception retaining TalendDate.parseDate function.
"TalendDate.parseDate("yyyy-MM-dd'T'hh:mm:ss z", row1.Date_TimeZone); "
Please see the screenshots.
Thanks for the reply. Hoping for a solution
Regards
Naju
708 Views

- « Previous Replies
-
- 1
- 2
- Next Replies »