Mercurial > hg > ltpda
diff m-toolbox/classes/+utils/@timetools/gps2utc.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/+utils/@timetools/gps2utc.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,34 @@ +% GPS2UTC converts GPS seconds to UTC time. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: GPS2UTC converts GPS seconds to UTC time. +% +% CALL: UTC_time=GPS2UTC(GPS_time) +% +% FORMAT: UTC time format: 'yyy-mm-dd- HH:MM:SS' +% GPS time format: Seconds since 6. January 1980 +% +% EXAMPLES: GPS_time=GPS2UTC(711129613) +% GPS_time='2002-07-19 16:00:00' +% +% VERSION: $Id: gps2utc.m,v 1.2 2010/02/01 15:35:10 ingo Exp $ +% +% HISTORY: xx-xx-xxxx Karsten Koetter +% Creation +% 24-01-2007 M Hewitson. +% Maintained +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function UTC_time = gps2utc(GPS_time) + + leapSecond = 15; + + GPS_Epoch=datenum('01-06-1980 00:00:00')*86400; + NUM_time=GPS_Epoch+GPS_time-leapSecond; + + UTC_time=datestr(NUM_time/86400,31); + +end + +