OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
timeutils.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
Include dependency graph for timeutils.h:

Go to the source code of this file.

Functions

int isleap (int year)
 
time_t gmt_offset (void)
 
double yds2unix (int16_t year, int16_t day, double secs)
 
double yds2unix_ (int16_t *year, int16_t *day, double *secs)
 
void unix2yds (double usec, int16_t *year, int16_t *day, double *secs)
 
char * unix2ydhmsf (double usec, char zone)
 
double ymds2unix (int16_t year, int16_t month, int16_t day, double secs)
 
void unix2ymds (double usec, int16_t *year, int16_t *mon, int16_t *day, double *secs)
 
void unix2ymdhms (double usec, int16_t *year, int16_t *mon, int16_t *day, int16_t *hour, int16_t *min, double *sec)
 
void yd2md (int16_t year, int16_t doy, int16_t *month, int16_t *dom)
 
char * ydhmsf (double dtime, char zone)
 
double now (void)
 
void ymdhms2ydmsec (int yy, int mm, int dd, int hh, int mn, int sc, int32_t *year, int32_t *day, int32_t *msec)
 
void date2ydmsec (char *date, int32_t *year, int32_t *day, int32_t *msec)
 
void isodate2ydmsec (char *date, int32_t *year, int32_t *day, int32_t *msec)
 
char * unix2isodate (double dtime, char zone)
 
double zulu2unix (char *zulu)
 
double isodate2unix (const char *isodate)
 
void addmsec (int32_t *year, int32_t *day, int32_t *msec, int32_t delta)
 
void get_time (char *pr_time)
 
int leapseconds_since_1993 (double tai93time)
 
int leapseconds_since_1993_unix (double unixtime)
 
double unix_to_tai93 (double unixtime)
 
double tai93_to_unix (double tai93)
 
double unix_to_tai58 (double unixtime)
 
double tai58_to_unix (double tai58)
 
int32_t jday (int16_t i, int16_t j, int16_t k)
 
int jdate (int32_t julian, int32_t *year, int32_t *doy)
 
double yds2tai93 (int16_t iyr, int16_t idy, double sec)
 
int ccsds_to_yds (uint8_t *cctime, int32_t *iyear, int32_t *iday, double *sec)
 

Function Documentation

◆ addmsec()

void addmsec ( int32_t *  year,
int32_t *  day,
int32_t *  msec,
int32_t  delta 
)

Definition at line 3 of file addmsec.c.

◆ ccsds_to_yds()

int ccsds_to_yds ( uint8_t *  cctime,
int32_t *  iyear,
int32_t *  iday,
double *  sec 
)

Definition at line 5 of file ccsds_to_yds.c.

◆ date2ydmsec()

void date2ydmsec ( char *  date,
int32_t *  year,
int32_t *  day,
int32_t *  msec 
)

Definition at line 4 of file date2ydmsec.c.

◆ get_time()

void get_time ( char *  pr_time)

Definition at line 28 of file get_time.c.

◆ gmt_offset()

time_t gmt_offset ( void  )

Definition at line 8 of file gmt_offset.c.

◆ isleap()

int isleap ( int  year)

Definition at line 3 of file isleap.c.

◆ isodate2unix()

double isodate2unix ( const char *  isodate)

Definition at line 61 of file unix2isodate.c.

◆ isodate2ydmsec()

void isodate2ydmsec ( char *  date,
int32_t *  year,
int32_t *  day,
int32_t *  msec 
)

Definition at line 20 of file date2ydmsec.c.

◆ jdate()

int jdate ( int32_t  julian,
int32_t *  year,
int32_t *  doy 
)

Definition at line 5 of file jdate.c.

◆ jday()

int32_t jday ( int16_t  i,
int16_t  j,
int16_t  k 
)

Definition at line 4 of file jday.c.

◆ leapseconds_since_1993()

int leapseconds_since_1993 ( double  tai93time)

Definition at line 58 of file leapsecond.c.

◆ leapseconds_since_1993_unix()

int leapseconds_since_1993_unix ( double  unixtime)

Definition at line 71 of file leapsecond.c.

◆ now()

double now ( void  )

Definition at line 361 of file HISTORY.txt.

◆ tai58_to_unix()

double tai58_to_unix ( double  tai58)

Definition at line 29 of file yds2tai.c.

◆ tai93_to_unix()

double tai93_to_unix ( double  tai93)

Definition at line 16 of file yds2tai.c.

◆ unix2isodate()

char* unix2isodate ( double  dtime,
char  zone 
)

creates a time string "1994-11-05T13:15:30.123Z"

Parameters
dtimeunix time as a double
zonetime zone character 'G'=gmt, 'L'=local
Returns
ISO 8601 time string (internal memory)

Definition at line 10 of file unix2isodate.c.

◆ unix2ydhmsf()

char* unix2ydhmsf ( double  usec,
char  zone 
)

Definition at line 8 of file unix2ydhmsf.c.

◆ unix2yds()

void unix2yds ( double  usec,
int16_t *  year,
int16_t *  day,
double *  secs 
)

Definition at line 7 of file unix2yds.c.

◆ unix2ymdhms()

void unix2ymdhms ( double  usec,
int16_t *  year,
int16_t *  mon,
int16_t *  day,
int16_t *  hour,
int16_t *  min,
double *  sec 
)

Definition at line 8 of file unix2ymdhms.c.

◆ unix2ymds()

void unix2ymds ( double  usec,
int16_t *  year,
int16_t *  mon,
int16_t *  day,
double *  secs 
)

Definition at line 8 of file unix2ymds.c.

◆ unix_to_tai58()

double unix_to_tai58 ( double  unixtime)

Definition at line 23 of file yds2tai.c.

◆ unix_to_tai93()

double unix_to_tai93 ( double  unixtime)

Definition at line 11 of file yds2tai.c.

◆ yd2md()

void yd2md ( int16_t  year,
int16_t  doy,
int16_t *  month,
int16_t *  dom 
)

Definition at line 6 of file yd2md.c.

◆ ydhmsf()

char* ydhmsf ( double  dtime,
char  zone 
)

Definition at line 12 of file ydhmsf.c.

◆ yds2tai93()

double yds2tai93 ( int16_t  iyr,
int16_t  idy,
double  sec 
)

Definition at line 4 of file yds2tai.c.

◆ yds2unix()

double yds2unix ( int16_t  year,
int16_t  day,
double  secs 
)

Definition at line 7 of file yds2unix.c.

◆ yds2unix_()

double yds2unix_ ( int16_t *  year,
int16_t *  day,
double *  secs 
)

Definition at line 34 of file yds2unix.c.

◆ ymdhms2ydmsec()

void ymdhms2ydmsec ( int  yy,
int  mm,
int  dd,
int  hh,
int  mn,
int  sc,
int32_t *  year,
int32_t *  day,
int32_t *  msec 
)

Definition at line 3 of file ydhms2ydmsec.c.

◆ ymds2unix()

double ymds2unix ( int16_t  year,
int16_t  month,
int16_t  day,
double  secs 
)

Definition at line 9 of file ymds2unix.c.

◆ zulu2unix()

double zulu2unix ( char *  zulu)

Definition at line 3 of file zulu2unix.c.