libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
das_time Struct Reference

#include <das2/time.h>

Detailed Description

Basic date-time structure used throughout the Das1 & Das2 utilities.

In all das rountines, times are assumed to be UTC. Since we are dealing with spacecraft far from Earth, local time zones are of no consideration in almost all cases.

Public Member Functions

bool dt_parsetime (const char *string, das_time *dt)
 Convert most human-parseable time strings to numeric components. More...
 
void dt_from_1958 (unsigned short int daysSince1958, unsigned int msOfDay, das_time *dt)
 Get a das time given days since 1958 and optional milliseconds of day. More...
 
int64_t dt_nano_1970 (const das_time *dt)
 Convert a das time to integer nanoseconds since 1970-01-01. More...
 
bool dt_in_range (const das_time *begin, const das_time *end, const das_time *test)
 Test for time within a time range The the standard exclusive upper bound test. More...
 
void dt_copy (das_time *pDest, const das_time *pSrc)
 Simple helper to copy values from one das time to another.
 
void dt_set (das_time *pDt, int year, int month, int mday, int yday, int hour, int minute, double second)
 Simple helper to set values in a das time. More...
 
int dt_compare (const das_time *pA, const das_time *pB)
 Compare to dastime structures. More...
 
double dt_diff (const das_time *pA, const das_time *pB)
 Get the difference of two das_time structures in seconds. More...
 
char * dt_isoc (char *sBuf, size_t nLen, const das_time *pDt, int nFracSec)
 Print an ISOC standard time string given a das_time structure. More...
 
char * dt_isod (char *sBuf, size_t nLen, const das_time *pDt, int nFracSec)
 Print an ISOD standard time string given a das_time structure. More...
 
char * dt_dual_str (char *sBuf, size_t nLen, const das_time *pDt, int nFracSec)
 Print time a string that provides both day of month and day of year given a das_time structure. More...
 
double dt_ttime (const das_time *dt)
 Convert time components to double seconds since January 1st 1958. More...
 
void dt_emitt (double tt, das_time *dt)
 convert double seconds since epoch to time components. More...
 
void dt_tnorm (das_time *dt)
 Normalize date and time components. More...
 

Data Fields

int year
 Calendar year number, cannot hold years before 1 AD.
 
int month
 Calendar month number, 1 = January.
 
int mday
 Calender Day of month, starts at 1.
 
int yday
 Integer Day of year, Jan. More...
 
int hour
 Hour of day, range is 0 to 23.
 
int minute
 Minute of the hour, range 0 to 59.
 
double second
 Second of the minute, range 0.0 to 60.0 - epsilon. More...
 

Field Documentation

int yday

Integer Day of year, Jan.

1st = 1. This field is output only for most Das1 functions see the warning in dt_tnorm()

double second

Second of the minute, range 0.0 to 60.0 - epsilon.

Note, there is no provision for leap seconds in the library. All minutes are assumed to have 60 seconds.


The documentation for this struct was generated from the following file: