DateTimeService class
Provides time locally and in specific timezones.
Constructors
- DateTimeService()
-
Gets the DateTimeService singleton.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
localNow(
) → DateTime - Returns the current time in the local timezone.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
now(
String timezone) → TZDateTime -
Returns the current time in the specified
timezone. Example: 'America/New_York', 'Europe/London', 'Asia/Tokyo' -
toString(
) → String -
A string representation of this object.
inherited
-
translate(
DateTime dateTime, String timezoneName) → TZDateTime - Helper to convert an existing DateTime to a specific timezone
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited