简体   繁体   中英

How to get particular month starting date of current year in flutter

如何在颤动中以编程方式获取当前年份的开始日期或特定月份的开始日期

import 'package:intl/intl.dart';

main() {
  static final DateTime now = DateTime.now();
  static final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  print(formatted); // something like 2022-04-20
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM