
is there any possiblity to get current date instead of system date in Java, as i dont want to change date in program and if i change date in OS automatically change in program also ?

Hello Friend,
Try the given code:
import java.util.*;
import java.text.*;
class DateExample{
public static void main(String[] args){
Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
String date=sdf.format(d);
}
}
Thanks

thanks
This code is used system date and if i am change system date code also change the date, i dont want it.