how to display current date time in flutter
DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ;
how to display current date time in flutter
DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ;
flutter datetime.now only time
import 'package:intl/intl.dart';
DateTime now = DateTime.now();
String formattedTime = DateFormat.Hms().format(now);
print(formattedTime);
how to show date only in flutter
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Current Date Example',
home: DateExample(),
);
}
}
class DateExample extends StatelessWidget {
const DateExample({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(child: Text(DateFormat("yyyy-MM-dd").format(DateTime.now()))),
);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us