A DateTime object is a point in time. The time zone is either UTC or the local time zone. Accurate date-time handling is required in almost every data context. Dart has the marvelous built-in classes DateTime and Duration in dart:core.Some of its uses are:
- Compare and calculate with date times
- Get every part of a date-time
- Work with different time zones
- Measure time spans
2020-08-25 11:58:56.257 2000-01-01 00:00:00.000 2000-01-02 00:00:00.000 2000-01-01 00:00:00.000Z 2000-01-01 00:00:00.000Z 2000-01-01 00:00:00.000Z
The millisecondsSinceEpoch property of a date returns the number of milliseconds since the “Unix epoch”—January 1, 1970, UTC.
The Duration class can be used to calculate the difference between two dates and to move date forward or backward.
true true true
- Dart - Super and This keyword
- Dart - Classes And Objects
- Dart - Loop Control Statements (Break and Continue)
- Instance and class methods in Dart
- Getter and Setter Methods in Dart
- Dart - Finding Minimum and Maximum Value in a List
- Dart - Const And Final Keyword
- HTML Document Object Model and Dart Programming
- Variables and Keywords in Dart
- What is Lexical scope and lexical closures in Dart
- Dart - Getters and Setters
- Difference Between DART and C++
- Upload and Retrieve Images on MongoDB using Dart in Flutter
- How to Combine Lists in Dart?
- Basics of Numbers in Dart
- Dart - Standard Input Output
- Generators in Dart
- Operators in Dart
- Dart - Loops
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.