本文整理汇总了Java中org.threeten.bp.LocalDate.now方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDate.now方法的具体用法?Java LocalDate.now怎么用?Java LocalDate.now使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threeten.bp.LocalDate
的用法示例。
在下文中一共展示了LocalDate.now方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.threeten.bp.LocalDate; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidThreeTen.init(this);
start_date = LocalDate.now();
end_date = LocalDate.now();
seed = DEFAULT_SEED;
setContentView(R.layout.activity_main);
// Load an ad into the AdMob banner view.
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().setRequestAgent("android_studio:ad_template").build();
adView.loadAd(adRequest);
potd_list_view = (ListView) findViewById(R.id.potd_list);
generate_potd_list();
}
示例2: onCreateDialog
import org.threeten.bp.LocalDate; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final LocalDate date = LocalDate.now();
int year = date.getYear();
// threeten's LocalDate months are zero-indexed.
int month = date.getMonthValue() - 1;
int day = date.getDayOfMonth();
// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}
示例3: setup
import org.threeten.bp.LocalDate; //导入方法依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
ScheduleDay scheduleDay = new ScheduleDay(LocalDate.now(), slots);
presenter = new ScheduleDayPresenter(view, scheduleDay);
}
示例4: getDate
import org.threeten.bp.LocalDate; //导入方法依赖的package包/类
private static LocalDate getDate(int hour, int minute) {
if (LocalTime.of(hour, minute).isAfter(LocalTime.now())) {
return LocalDate.now();
}
return LocalDate.now().plusDays(1);
}