mtime 1.2.2
Loading...
Searching...
No Matches
mtime_datetime.h File Reference

DateTime and some operations supported on DateTime. More...

#include <stdint.h>
#include <stdbool.h>
#include "mtime_date.h"
#include "mtime_time.h"
Include dependency graph for mtime_datetime.h:

Go to the source code of this file.

Data Structures

struct  _datetime
 struct _datetime contains a struct _date and a struct _time element. More...
 

Functions

struct _datetimenewDateTime (const char *datetime_string)
 Construct new DateTime using an ISO 8601 conforming string.
 
struct _datetimenewRawDateTime (int64_t _year, int _month, int _day, int _hour, int _minute, int _second, int _ms)
 Construct new DateTime using 'raw' numerical values.
 
struct _datetimeconstructAndCopyDateTime (struct _datetime *dt)
 Copy the values and construct a new datetime.
 
void deallocateDateTime (struct _datetime *dt)
 Destructor of DateTime.
 
compare_return_val compareDatetime (struct _datetime *dt1, struct _datetime *dt2)
 Compare two datetimes and return (dt1 > dt2) OR (dt1 = dt2) OR (dt1 < dt2).
 
struct _datetimereplaceDatetime (struct _datetime *dtsrc, struct _datetime *dtdest)
 COPY a DateTime object.
 
char * datetimeToString (struct _datetime *dt, char *toStr)
 Get DateTime as a string.
 
char * datetimeToBasicString (struct _datetime *dt, char *toStr)
 Get DateTime as a basic string.
 
char * datetimeToPosixString (struct _datetime *dt, char *toStr, char *fmtString)
 Get DateTime in 'struct tm' format and return as a string.
 
int getNoOfDaysInMonthDateTime (struct _datetime *dt)
 Get nod (number of Days) in the month of DateTime.
 
int getNoOfDaysInYearDateTime (struct _datetime *dt)
 Get number of days in the Year of DateTime.
 
int getDayOfYearFromDateTime (struct _datetime *currentdt)
 Get the 'day-of-year' value of a DateTime.
 
int64_t getNoOfSecondsElapsedInMonthDateTime (struct _datetime *dt)
 Get number of seconds elapsed in the month of DateTime.
 
int getNoOfSecondsElapsedInDayDateTime (struct _datetime *dt)
 Get number of seconds elapsed in the day of DateTime.
 
struct _juliandaygetJulianDayFromDateTime (struct _datetime *dt, struct _julianday *jd)
 Get the Julian Day from DateTime.
 
struct _datetimegetDateTimeFromJulianDay (struct _julianday *jd, struct _datetime *dt)
 Get the DateTime from Julian Day.
 
compare_return_val getDateTimeIsInRange (struct _datetime *dtRef, struct _datetime *dtStart, struct _datetime *dtEnd)
 

Detailed Description

DateTime and some operations supported on DateTime.

Author
Luis Kornblueh, Max Planck Institute for Meteorology.
Rahul Sinha, Max Planck Institute for Meteorology.
Date
March 2013