seconds 1.0.6
seconds: ^1.0.6 copied to clipboard

Simple functions to work with seconds. Used for compact dateTime storage (e.g. in database, or JWT "iat" claim).

example/example.dart

import 'package:seconds/seconds.dart';

void main() async {
  final DateTime now = DateTime.now();

  //Do not call a variable "secondsNowUTC" as
  //secondsNowUTC is a library getter, as shown below
  final int secondsNow = secondsFromDateTimeUTC(now);

  await Future.delayed(const Duration(seconds: 1));

  final int secondsNowUTCbyGetter = secondsNowUTC;

  assert(secondsNowUTCbyGetter - secondsNow >= 1);
}
0
likes
90
pub points
0%
popularity

Publisher

darkandjeweled.com

Simple functions to work with seconds. Used for compact dateTime storage (e.g. in database, or JWT "iat" claim).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

datetime_utc_converter

More

Packages that depend on seconds