julian 0.0.1 copy "julian: ^0.0.1" to clipboard
julian: ^0.0.1 copied to clipboard

outdatedDart 1 only

Convert between Julian day numbers, proleptic Julian calendar days and proleptic Gregorian calendar days.

example/julian_example.dart

// Copyright (c) 2016, <Christian Stewart>. 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:julian/julian.dart';

main() {
  /*
  What was the Julian day number at the turn of the millennium?
   */
  // prints 2451545
  print('${new Gregorian(2000, 1, 1).julianDayNumber}');

  /*
  On which Gregorian day of July should we celebrate Julius Caesar's birthday?
   */
  // prints 11
  print('${new Julian.fromBC(100, 7, 13).toGregorian().day}');

  /*
  By how many days is the Gregorian calendar further ahead than the Julian
  calendar in 2016?
   */
  // prints 13
  print('${new Julian(2016, 1, 1).julianDayNumber -
      new Gregorian(2016, 1, 1).julianDayNumber}');

  /*
  On what Gregorian date is the Julian day number equal to zero?
   */
  // prints Gregorian(year: -4713 (i.e. 4714 BC), month: 11, day: 24)
  print('${new Gregorian.fromJulianDayNumber(0)}');
}
0
likes
0
pub points
12%
popularity

Publisher

unverified uploader

Convert between Julian day numbers, proleptic Julian calendar days and proleptic Gregorian calendar days.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on julian