import
'package:flutter/material.dart'
;
import
'package:intl/intl.dart'
;
void
main() {
runApp(dateDemo());
}
class
dateDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return
MaterialApp(
title:
"Date-Demo"
,
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.green.shade900,
title: Text(
"Geeksforgeeks"
),
),
body: Container(
width:
double
.infinity,
child:
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
DateFormat.yMMMEd().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.MEd().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.MMMMEEEEd().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.yMMMMEEEEd().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.EEEE().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.E().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.M().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.MMM().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.LLLL().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
DateFormat.j().format(DateTime.now()),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
]),
)),
);
}
}