julianday

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 5 Imported by: 7

README

Julian Day calculator

Go Reference Go Report Go Coverage

https://en.wikipedia.org/wiki/Julian_day

Compatible with SQLite.

Documentation

Overview

Package julianday provides Time to Julian day conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFormat

func AppendFormat(dst []byte, t time.Time) []byte

AppendFormat is like Format but appends the textual representation to dst and returns the extended buffer.

func Date

func Date(t time.Time) (day, nsec int64)

Date returns the Julian day number for t, and the nanosecond offset within that day, in the range [0, 86399999999999].

func Float

func Float(t time.Time) float64

Float returns the Julian date for t as a float64.

In the XXI century, this has submillisecond precision.

func FloatTime

func FloatTime(date float64) time.Time

FloatTime returns the UTC Time corresponding to a Julian date. Not all date values have a corresponding time value.

In the XXI century, this has submillisecond precision.

func Format

func Format(t time.Time) string

Format returns the Julian date for t as a string.

This has nanosecond precision.

func Parse

func Parse(s string) (time.Time, error)

Parse parses a formatted Julian date and returns the UTC Time it represents.

This has nanosecond precision.

func Time

func Time(day, nsec int64) time.Time

Time returns the UTC Time corresponding to the Julian day number and nanosecond offset within that day. Not all day values have a corresponding time value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL