Skip to content

Instantly share code, notes, and snippets.

@gahms
Last active March 14, 2024 12:37
Show Gist options
  • Select an option

  • Save gahms/37a5ca9f40f1c3ec90645430942e8936 to your computer and use it in GitHub Desktop.

Select an option

Save gahms/37a5ca9f40f1c3ec90645430942e8936 to your computer and use it in GitHub Desktop.
DartPad date format example
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
void main() async {
await initializeDateFormatting();
final dt = DateTime.now();
print(DateFormat.yMd('en_UK').format(dt));
print(DateFormat.yMd('da_DK').format(dt));
print(DateFormat('dd.MM.yyyy').format(dt));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment