time_conversion.h
Go to the documentation of this file.
1 // TAKEN FROM https://svn.code.sf.net/p/gnsstk/code/trunk/src/time_conversion.h
2 
48 #ifndef _C_TIMECONV_H_
49 #define _C_TIMECONV_H_
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*************************************************************************************************/
56 // preprocessor constant definitions, any related enumerations and descriptors
57 
58 // error, define to printf or something if you want
59 #define GNSS_ERROR_MSG(errorMsg)
60 
61 #ifndef SECONDS_IN_DAY
62 #define SECONDS_IN_DAY (86400.0)
63 #endif
64 
65 #ifndef SECONDS_IN_WEEK
66 #define SECONDS_IN_WEEK (604800.0)
67 #endif
68 
79  unsigned short* utc_year,
80  unsigned char* utc_month,
81  unsigned char* utc_day,
82  unsigned char* utc_hour,
83  unsigned char* utc_minute,
84  float* utc_seconds,
85  unsigned char* utc_offset,
86  double* julian_date,
87  unsigned short* gps_week,
88  double* gps_tow
89  );
90 
91 
92 #ifdef WIN32
93 
101 int TIMECONV_SetSystemTime(
102  const unsigned short utc_year,
103  const unsigned char utc_month,
104  const unsigned char utc_day,
105  const unsigned char utc_hour,
106  const unsigned char utc_minute,
107  const float utc_seconds
108  );
109 #endif
110 
111 
124  const double julian_date,
125  unsigned char *day_of_week
126  );
127 
128 
142  const unsigned short gps_week,
143  const double gps_tow,
144  const unsigned char utc_offset,
145  double* julian_date
146  );
147 
166  const unsigned short utc_year,
167  const unsigned char utc_month,
168  const unsigned char utc_day,
169  const unsigned char utc_hour,
170  const unsigned char utc_minute,
171  const float utc_seconds,
172  double* julian_date
173  );
174 
175 
176 
177 
191  const double julian_date,
192  const unsigned char utc_offset,
193  unsigned short* gps_week,
194  double* gps_tow
195  );
196 
210  const double julian_date,
211  unsigned short* utc_year,
212  unsigned char* utc_month,
213  unsigned char* utc_day,
214  unsigned char* utc_hour,
215  unsigned char* utc_minute,
216  float* utc_seconds
217  );
218 
235  unsigned short utc_year,
236  unsigned char utc_month,
237  unsigned char utc_day,
238  unsigned char utc_hour,
239  unsigned char utc_minute,
240  float utc_seconds,
241  unsigned short* gps_week,
242  double* gps_tow
243  );
244 
245 
265  unsigned short utc_year,
266  unsigned char utc_month,
267  unsigned char utc_day,
268  unsigned char utc_hour,
269  unsigned char utc_minute,
270  float utc_seconds,
271  unsigned short* gps_week,
272  double* gps_tow
273  );
274 
275 
292  unsigned short gps_week,
293  double gps_tow,
294  unsigned short* utc_year,
295  unsigned char* utc_month,
296  unsigned char* utc_day,
297  unsigned char* utc_hour,
298  unsigned char* utc_minute,
299  float* utc_seconds
300  );
301 
302 
303 
338  double julian_date,
339  unsigned char* utc_offset
340  );
341 
355  const unsigned short year,
356  const unsigned char month,
357  unsigned char* days_in_month
358  );
359 
360 
372 int TIMECONV_IsALeapYear( const unsigned short year );
373 
374 
387  const unsigned short utc_year, // Universal Time Coordinated [year]
388  const unsigned char utc_month, // Universal Time Coordinated [1-12 months]
389  const unsigned char utc_day, // Universal Time Coordinated [1-31 days]
390  unsigned short* dayofyear // number of days into the year (1-366) [days]
391  );
392 
393 
403  const unsigned short year, // The year [year]
404  const unsigned short dayofyear, // The number of days into the year (1-366) [days]
405  unsigned short* gps_week,
406  double* gps_tow
407  );
408 
409 
410 
411 #ifdef __cplusplus
412 }
413 #endif
414 
415 
416 #endif // _C_TIMECONV_H_
int TIMECONV_GetUTCTimeFromJulianDate(const double julian_date, unsigned short *utc_year, unsigned char *utc_month, unsigned char *utc_day, unsigned char *utc_hour, unsigned char *utc_minute, float *utc_seconds)
Computes UTC time from the Julian date.
int TIMECONV_IsALeapYear(const unsigned short year)
Determines if the given year is a leap year.
int TIMECONV_GetUTCTimeFromGPSTime(unsigned short gps_week, double gps_tow, unsigned short *utc_year, unsigned char *utc_month, unsigned char *utc_day, unsigned char *utc_hour, unsigned char *utc_minute, float *utc_seconds)
Computes UTC time from GPS time.
int TIMECONV_GetGPSTimeFromRinexTime(unsigned short utc_year, unsigned char utc_month, unsigned char utc_day, unsigned char utc_hour, unsigned char utc_minute, float utc_seconds, unsigned short *gps_week, double *gps_tow)
Computes GPS time from RINEX time. RINEX time looks like UTC but it is GPS time in year...
int TIMECONV_GetDayOfWeekFromJulianDate(const double julian_date, unsigned char *day_of_week)
Computes the day of the week from the Julian date.
int TIMECONV_GetSystemTime(unsigned short *utc_year, unsigned char *utc_month, unsigned char *utc_day, unsigned char *utc_hour, unsigned char *utc_minute, float *utc_seconds, unsigned char *utc_offset, double *julian_date, unsigned short *gps_week, double *gps_tow)
Obtains the UTC time, GPS time, and Julian date from PC system time.
int TIMECONV_GetDayOfYear(const unsigned short utc_year, const unsigned char utc_month, const unsigned char utc_day, unsigned short *dayofyear)
Determines the day of year given the year, month, and day.
int TIMECONV_DetermineUTCOffset(double julian_date, unsigned char *utc_offset)
This function is a look up table to determine the UTC offset from the Julian Date.
int TIMECONV_GetGPSTimeFromJulianDate(const double julian_date, const unsigned char utc_offset, unsigned short *gps_week, double *gps_tow)
Computes GPS time from the Julian date.
int TIMECONV_GetGPSTimeFromYearAndDayOfYear(const unsigned short year, const unsigned short dayofyear, unsigned short *gps_week, double *gps_tow)
Determines the GPS time of the start of a day from the day of year and the year.
int TIMECONV_GetNumberOfDaysInMonth(const unsigned short year, const unsigned char month, unsigned char *days_in_month)
Determines the number of days in a month, given the month and year.
int TIMECONV_GetGPSTimeFromUTCTime(unsigned short utc_year, unsigned char utc_month, unsigned char utc_day, unsigned char utc_hour, unsigned char utc_minute, float utc_seconds, unsigned short *gps_week, double *gps_tow)
Computes GPS time from UTC time.
int TIMECONV_GetJulianDateFromGPSTime(const unsigned short gps_week, const double gps_tow, const unsigned char utc_offset, double *julian_date)
Computes the Julian date from GPS time.
int TIMECONV_GetJulianDateFromUTCTime(const unsigned short utc_year, const unsigned char utc_month, const unsigned char utc_day, const unsigned char utc_hour, const unsigned char utc_minute, const float utc_seconds, double *julian_date)
Computes the Julian date from UTC time.


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58