简体   繁体   中英

How to get the current day in flutter?

I want to get the current day using dart.

Code I want:-

//I want something like this

var day = DateTime.getCurrentDay();

Output:-

Tuesday
// DateTime.now() or any DateTime format can be used.
DateFormat('EEEE').format(DateTime.now());

To use other Date formats/patterns like "EEEE" you can visit the Official Documentation

use this pattern

DateFormat('EEEE').format(yourDate);

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