Skip to content

Usage

Import

The module can be imported as:

Import
import "git.gfz-potsdam.de/gnss/tools/dateconv/dateconv"

Initialize

You can initialize a dateconv object as:

Initialize with string and format
timeObj, err := dateconv.NewConversion("2023-01-01", "yyyymmdd", "")
if err != nil {
    fmt.Println(err)
}

Console Application

The application ships also with a terminal client application:

dateconv convert

Note

If passed without any arguments, the current datetime in UTC will be used.

The result is as follows:

Output
   -----------------------------------------------------
   | YYYY mm DD  DDD    MJD  GPSW.D  Second  Weekday   |
   -----------------------------------------------------
   | 2021 12 26  360  59574  2190.0       0  Sunday    |
   | 2021 12 27  361  59575  2190.1   86400  Monday    |
   | 2021 12 28  362  59576  2190.2  172800  Tuesday   |
   | 2021 12 29  363  59577  2190.3  259200  Wednesday |
   | 2021 12 30  364  59578  2190.4  345600  Thursday  |
   | 2021 12 31  365  59579  2190.5  432000  Friday    |
>> | 2022 01 01  001  59580  2190.6  518400  Saturday  |
   -----------------------------------------------------

   -----------------------------------------------------
   | HH MM SS  Unix        MJDF                        |
   -----------------------------------------------------
   | 00 00 00  1640995200  59580.00000                 |
   -----------------------------------------------------