octal_clock 0.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 86

octal_clock

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

Octal time does away with the cumbersome 12-based imperial system of time keeping, where you can't count using only your fingers and everything is weird and awkward. By switching to octal time, we get all the benefits of a metric-style system, and keep the benefit of being able to easily half and quarter time measurements.

The basics of the system are as follows:
1000<sub>8</sub> microseconds per millisecond.
1000<sub>8</sub> milliseconds per second.
100<sub>8</sub> seconds per minute.
100<sub>8</sub> octal minutes per hour.
10<sub>8</sub> octal hours per scisma.
3 scismas per day.

A "scisma" is much like AM/PM, except there are three of them: Morning (Mane Scisma/MS), Day (Dies Scisma/DS), Evening (Vesperum Scisma/VS). For the purposes of simplification Mane Scisma starts at 12:00 AM imperial time.

Why 3 scismas?
In the slightly modified words of Robert Owen, "[1 Scisma]'s labour, [1 Scisma]'s recreation, [1 Scisma]'s rest".
... Also, because 30<sub>8</sub> is 24<sub>10</sub>, so all the hours line up and our math is pretty and we don't need to change the calendar.

Usage

A simple usage example:

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}');
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.5

  • Exporting the converter.dart util so it can be used by others

0.0.4

  • Fixing typo in HOURS_PER_SCISMA constant

0.0.3

  • Adding a constants for SCISMAS_PER_DAY and HOURS_PER_SCISMA

0.0.2

  • Updating my name in the license comments

0.0.1

  • Initial version
  • Basic DateTime and Duration implementations

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}');
}

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  octal_clock: "^0.0.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:octal_clock/octal_clock.dart';
        
Version Uploaded Documentation Archive
0.0.5 Oct 20, 2017 Go to the documentation of octal_clock 0.0.5 Download octal_clock 0.0.5 archive
0.0.4 Oct 20, 2017 Go to the documentation of octal_clock 0.0.4 Download octal_clock 0.0.4 archive
0.0.3 Oct 20, 2017 Go to the documentation of octal_clock 0.0.3 Download octal_clock 0.0.3 archive
0.0.2 Oct 16, 2017 Go to the documentation of octal_clock 0.0.2 Download octal_clock 0.0.2 archive
0.0.1 Oct 16, 2017 Go to the documentation of octal_clock 0.0.1 Download octal_clock 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
73 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
86

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:octal_clock/octal_clock.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
test ^0.12.0