NepaliDateTime class
An instant in time, such as Mangsir 05, 2076, 11:05am
- Implemented types
- Available extensions
Constructors
- NepaliDateTime(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
- Constructs a NepaliDateTime instance specified.
- NepaliDateTime.fromDateTime(DateTime dateTime)
-
Converts the specified DateTime to NepaliDateTime.
factory
- NepaliDateTime.now()
-
Constructs a DateTime instance with current date and time
factory
Properties
- day → int
-
The day of the month
[1..31]
.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hour → int
-
The hour of the day, expressed as in a 24-hour clock
[0..23]
.final - isUtc → bool
-
True if this DateTime is set to UTC time.
no setteroverride
- microsecond → int
-
The microsecond
[0...999]
.final - microsecondsSinceEpoch → int
-
The number of microseconds since
the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
- millisecond → int
-
The millisecond
[0...999]
.final - millisecondsSinceEpoch → int
-
The number of milliseconds since
the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
- minute → int
-
The minute
[0...59]
.final - month → int
-
The month
[1..12]
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → int
-
The second
[0...59]
.final - timeZoneName → String
-
The time zone name.
no setteroverride
- timeZoneOffset → Duration
-
The time zone offset, which
is the difference between local time and UTC.
no setteroverride
- totalDays → int
-
Returns total days in the month of the year.
no setter
- totalDaysInYear → int
-
Returns total days in the year.
no setter
- weekday → int
-
The day of the week Sunday..Saturday.
no setteroverride
- year → int
-
The year.
final
Methods
-
add(
Duration duration) → NepaliDateTime -
Returns a new DateTime instance with
duration
added to this DateTime.override -
compareTo(
covariant NepaliDateTime other) → int -
Compares this DateTime object to
other
, returning zero if the values are equal.override -
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond, bool? isUtc}) → DateTime -
Available on DateTime, provided by the DateTimeCopyWith extension
Creates a new DateTime from this one by updating individual properties. -
difference(
covariant NepaliDateTime other) → Duration -
Returns a Duration with the difference when subtracting
other
from this DateTime.override -
format(
String pattern, [Language? language]) → String - Formats NepaliDateTime as per the pattern provided.
-
isAfter(
covariant NepaliDateTime nepaliDateTime) → bool -
Returns true if this occurs after other
override
-
isAtSameMomentAs(
covariant NepaliDateTime other) → bool -
Whether this DateTime occurs at the same moment as
other
.override -
isBefore(
covariant NepaliDateTime nepaliDateTime) → bool -
Returns true if this occurs before other.
override
-
mergeTime(
int hour, int minute, int second) → NepaliDateTime - Merges specified time to current date.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subtract(
Duration duration) → NepaliDateTime -
Returns a new DateTime instance with
duration
subtracted from this DateTime.override -
toDateTime(
) → DateTime - Converts the NepaliDateTime to corresponding DateTime.
-
toIso8601String(
) → String -
Returns an ISO-8601 full-precision extended format representation.
override
-
toLocal(
) → NepaliDateTime -
Returns this DateTime value in the local time zone.
override
-
toNepaliDateTime(
) → NepaliDateTime -
Available on DateTime, provided by the ENepaliDateTime extension
Converts the DateTime to NepaliDateTime. -
toString(
) → String -
Returns a human-readable string for this instance.
override
-
toUtc(
) → DateTime -
Returns this DateTime value in the UTC time zone.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parse(
String formattedString) → NepaliDateTime -
Constructs a new DateTime instance based on
formattedString
.override -
tryParse(
String formattedString) → NepaliDateTime? -
Constructs a new NepaliDateTime instance based on formattedString.
override