on 08-05-2008 3:05 PM
Hi All,
While mapping i need the value into field with
yyyy-mm-dd-hh.mm.ss.mmmmm format. I tried in currentDate function having the format of yyyy-mm-dd hh-mm-ss But how to get mmmmm value and How I can set . (DOT) as separator. Could you please help me ?
Thanks,
hi,
y face the same problem
i did this:
i use the trans date and a udf to get the time. later i concat it.
here my udf. getTime
//write your code here
Calendar cal = Calendar.getInstance();
String s_hs= "";
String s_min= "";
String s_seg= "";
//check if hour is less than 10. values less than 10 use 1 character --> (1am) t o(01am)
if (cal.get(cal.HOUR) < 10){
s_hs = "0" + String.valueOf(cal.get(cal.HOUR));
}else { s_hs = String.valueOf(cal.get(cal.HOUR));}
//check if min is less than 10. values less than 10 use 1 character --> (8) t o(08)
if (cal.get(cal.MINUTE) < 10){
s_min = "0" + String.valueOf(cal.get(cal.MINUTE));
}else { s_min = String.valueOf(cal.get(cal.MINUTE));}
//check if sec is less than 10. values less than 10 use 1 character --> (6) t o(06)
if (cal.get(cal.SECOND) < 10){
s_seg = "0" + String.valueOf(cal.get(cal.SECOND));
}else { s_seg = String.valueOf(cal.get(cal.SECOND));}
String hora = s_hs + "." +s_min +"." + s_seg;
return hora;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
u can write a udf for this.
and regarding DOT(.) separator..
u can use dateTransformation
there in format of sorce date give the sorce format time
and in TargetFormat give
hh.mm.ss it will work...
by the way from where u want to fill *mmmmm * month or minutes???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.