on 03-21-2016 11:31 AM
Hello experts,
I need UDF to map WeekendDate field as running week Sunday's date, where Monday is Week start day.
Hello Chetan,
you have B2B kit installed in the PI ESR.
Check if any of the Standard functions in the below link will help you out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try below Code
Calendar date = Calendar.getInstance(); |
int diff = Calendar.SUNDAY - date.get(Calendar.DAY_OF_WEEK);
if (!(diff > 0)) {
diff += 7;
}
date.add(Calendar.DAY_OF_MONTH, diff);
String strdate = null;
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
if (date != null) {
strdate = sdf.format(date.getTime());
}
return strdate;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
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.