god_of_the_mind 1.0.0 god_of_the_mind: ^1.0.0 copied to clipboard
God of the Mind ==> Visionary Software Solutions Time me_sure_meant API.
example/god_of_the_mind_example.dart
import 'package:me_sure_meant/me_sure_meant.dart';
import 'package:god_of_the_mind/god_of_the_mind.dart';
void main() {
timeDemo();
}
void timeDemo() {
/// Time is treated solely as units, advanced date/time manipulation
/// like Java's Joda Time will have to come from another library.
final seconds = Seconds.inKiloSeconds(crude(30));
final hours = seconds.toUnit(Hour());
areEqual(8.333333333333334.hours(), hours);
final minutes = hours + 60.minutes();
areEqual(9.333333333333334.hours(), minutes.toUnit(Hour()));
final days = (minutes + 3.days()).toUnit(Day());
areEqual(3.388888888888889.days(), days);
final mess =
(19000456.seconds() + 32.hours() + 48009222.minutes() - 711.days())
.toUnit(Second.megasecond);
print(mess);
assert(mess.magnitude.toNum() == 2838.2385759999997);
assert(mess.unit == Second.megasecond);
}
void areEqual(final one, final two) {
assert(one == two);
}