on 10-23-2009 9:24 AM
How do we capture currentDateTime upto milliseconds in graphical mapping???
Thanks in advance!!!
Edited by: SoumenDas2009 on Oct 23, 2009 10:34 AM
Hi Soumen,
Just go to the current time field and click on format and just add .MMM/.SSS to the current fielsd i hope it ll do do no udf is required as of i tested this recently in p.i 7.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Soumen,
A udf is required for this
String currentDateTime(String dateFormat) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
return sdf.format(cal.getTime());
}
import these libraries too
import java.util.Calendar;
import java.text.SimpleDateFormat;
The input dateFormat is the format that you are expecting the result. Some formats
dd MMMMM yyyy
yyyyMMdd
dd.MM.yy
MM/dd/yy
h:mm a
H:mm:ss:SSS
K:mm a,z
yyyy.MMMMM.dd GGG hh:mm aaa
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.