Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter get current date

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 2013-04-20
}
// https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html
Comment

flutter datetime.now only time

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedTime = DateFormat.Hms().format(now);
print(formattedTime);
Comment

how to display current date time in flutter

main() {
    var now = new DateTime.now();
    var formatter = new DateFormat('yyyy-MM-dd');
    String formattedDate = formatter.format(now);
    print(formattedDate); // 2016-01-25
} 
Comment

how to display current date time in flutter

DateTime now = new DateTime.now();
DateTime date = new DateTime(now.year, now.month, now.day);
Comment

how to display current date time in flutter

DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ; 
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter check variable has object 
Dart :: random element from list dart 
Dart :: get value from map with key flutter 
Dart :: how to convert string into integer in flutter 
Dart :: flutter container padding 
Dart :: return type of a function 
Dart :: how to add a listner to a object in dart 
Dart :: const issue on new flutter version 
Dart :: glowing buttons in flutter 
Dart :: flutter firebase_messaging 9 ios 
Dart :: dart remove the last letter in a string 
Swift :: swift generate random number 
Swift :: save date to userdefaults swift 
Swift :: swift has Top Notch 
Swift :: swift open web page 
Swift :: swft imageä 
Swift :: swift 5 func to increase number every time call 
Swift :: swiftui pintch to zoom 
Swift :: alamofire failure response body 
Swift :: change button text in swift 
Swift :: print an array in swift 
Swift :: unit testing swift ui 
Swift :: uiimageview set image swift 
Swift :: swift hex color 
Swift :: uitextview placeholder uikit ios 
Swift :: swft ui image 
Swift :: Prime number or not program in swift basic programs 
Swift :: swiftui radio button 
Swift :: did select row at 
Swift :: swiftui rounded specific corner 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =