octal_clock 0.0.3 copy "octal_clock: ^0.0.3" to clipboard
octal_clock: ^0.0.3 copied to clipboard

outdatedDart 1 only

A dart library to manage converting from standard times to octal time

example/octal_clock_example.dart

// Copyright (c) 2017, Brian Armstrong. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:octal_clock/octal_clock.dart';

main() {
  var octalDate = new OctalDateTime.now();
  print('Octal Time: ${octalDate}');

  // Even though we're passing in an int, we treat it as if it were octal
  var octalDuration = new OctalDuration(minutes: 74);
  var future = octalDate.add(octalDuration);
  print('The future: ${future}');

  var octalUtc = octalDate.toUtc();
  var utcAsLocal = new OctalDateTime(
      octalUtc.year,
      octalUtc.month,
      octalUtc.day,
      octalUtc.hour,
      octalUtc.minute,
      octalUtc.second,
      octalUtc.millisecond,
      octalUtc.microsecond);

  // Run this multiple time to observe the conversion errors
  var offset = utcAsLocal.difference(octalDate);
  print('Octal UTC offset: ${offset}');
}
3
likes
0
pub points
0%
popularity

Publisher

verified publisherflutter.institute

A dart library to manage converting from standard times to octal time

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on octal_clock