function time =  tstime(in_time)
%deals with argos satellite time 

%get the year
year_base = floor(in_time);
year = year_base+1900;

%determine leap year
leap = rem(year,4);

if leap == 0
    yeardays = 366;
else
    yeardays = 365;
end;

%get the day,minute,second
day_base = yeardays*(in_time-year_base);
jday = floor(day_base);
%change jday to caldate
[Y,month,day]=datevec(jul2date(jday,year));
hour_base = 24*(day_base-jday);
hour = floor(hour_base);
min_base = 60*(hour_base-hour);
min = floor(min_base);
sec_base = 60*(min_base-min);
sec=round(sec_base);

%for those odd 60 secs -- 102.3325
if sec>59
    min=min+1;
    sec=0;
end;

time=datenum(year,month,day,hour,min,sec);




