Showing results for 
Search instead for 
Did you mean: 

Help with DateTrans function YYYY-MM-DDTHH:MM:SS.sssZ

Former Member
0 Kudos

I am trying to map a datetime field supplied by a call from Sybase Unwired Platform.

It is sending the date as format 2011-11-15T15:10:13.944Z and I am trying to use the Datetrans function to convert to the 20111115 required by an IDOC date field.

I am using


as the input format but it fails with runtime error Illegal pattern character 'T'

Can anyone help ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


Use the standard function "DateTrans", and see mainly this Java help, you will know exactly all the possibilities:

be careful on lowercase and ippercase, because the mean is different !

[] (really good, )



Example: (not yours)

yyyy.MM.dd G 'at' HH:mm:ss z --> 2001.07.04 AD at 12:08:56 PDT

so with a text 'at'...

I'm sure you will have yours. Enjoy play.



Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you all

Mickael's link gave me the answer in needed.

I Used the dateTrans function with input format yyyy-MM-dd'T'HH:mm:ss.SSS'Z' and it converted beautifully.


Active Contributor
0 Kudos

Here is the udf to achieve this

create a udf function with input as parameter and pass the date string and return as string

Signature Variable

Type Argument    Name input  JavaType String

public String datesString(String input, Container container) throws StreamTransformationException{

	String input = "2011-11-15T15:10:13.944Z ";
	String parseDateString = input.substring(0,10);
	StringBuffer output = new StringBuffer().append(parseDateString.substring(0,4))
                         return output.toString();


Edited by: Baskar Gopal on Nov 17, 2011 9:36 AM

Active Contributor
0 Kudos

with the standard datetrans function, i dont think the format YYYY-MM-DDTHH:MM:SS.sssZ is supported.

you might have to write a simple UDF to help you out here for the date conversion.