Commit d87845f8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

No commit message

No commit message
parent d7754f9e
...@@ -902,11 +902,13 @@ void encode_timevalue(int days, int secs, int timeunit, double *timevalue) ...@@ -902,11 +902,13 @@ void encode_timevalue(int days, int secs, int timeunit, double *timevalue)
void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime) void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime)
{ {
static char func[] = "timeval2vtime";
int year, month, day, hour, minute; int year, month, day, hour, minute;
int rdate, rtime; int rdate, rtime;
int timeunit; int timeunit;
int calendar; int calendar;
int julday, secofday, days, secs; int julday, secofday, days, secs;
static int lwarn = TRUE;
*vdate = 0; *vdate = 0;
*vtime = 0; *vtime = 0;
...@@ -923,6 +925,12 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime) ...@@ -923,6 +925,12 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime)
{ {
if ( timeunit == TUNIT_YEAR ) timevalue *= 12; if ( timeunit == TUNIT_YEAR ) timevalue *= 12;
if ( (NINT(timevalue*10))%10 && lwarn )
{
Warning(func, "Possible wrong calculation of date/time!\nTime offset must be integer for time unit MONTH and YEAR!");
lwarn = FALSE;
}
month += NINT(timevalue); month += NINT(timevalue);
while ( month > 12 ) { month -= 12; year++; } while ( month > 12 ) { month -= 12; year++; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment