on 2020 Jan 28 6:59 AM
Hi All,
Can I know how can I change the date format to Hijri date format. For an example today's date is 2020-01-28 and I need to change to 3 Jumada II, 1441 AH (Hijiri Date) for today.
Regards,
Sandhya
Request clarification before answering.
Hi Sandhya
This is a very googleable question. One of the first hits is this Stack Overflow question. It seems there is support in the java.time package of Java 8 (which is what CPI is using), and the Joda-Time library has support as well.
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sandhya.ravi
If you've tried some code already, post it and describe what's not working. Obviously, a code snippet from Stack Overflow (or anywhere else, for that matter) is not necessarily going to fit your exact problem, but might very well still point you in the right direction.
Regards,
Morten
Hi Morten,
Yes I have tried to modify it from Stack Overflow where in the CPI in the libraries which are below is not accepting
import org.joda.time.chrono.IslamicChronology;
import org.joda.time.chrono.ISOChronology;
Code:
import com.sap.it.api.mapping.*;
import org.joda.time.Chronology;
import org.joda.time.LocalDate;
import org.joda.time.chrono.IslamicChronology;
import org.joda.time.chrono.ISOChronology;
def String customFunc(String todayHijri){
public class Test {
public static void main(String[] args) throws Exception {
Chronology iso = ISOChronology.getInstanceUTC();
Chronology hijri = IslamicChronology.getInstanceUTC();
LocalDate todayIso = new LocalDate(2013, 3, 31, iso);
LocalDate todayHijri = new LocalDate(todayIso.toDateTimeAtStartOfDay(),
hijri)
}
}
return todayHijri
}
Regards,Sandhya
User | Count |
---|---|
53 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.