Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % GPS2UTC converts GPS seconds to UTC time. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GPS2UTC converts GPS seconds to UTC time. | |
5 % | |
6 % CALL: UTC_time=GPS2UTC(GPS_time) | |
7 % | |
8 % FORMAT: UTC time format: 'yyy-mm-dd- HH:MM:SS' | |
9 % GPS time format: Seconds since 6. January 1980 | |
10 % | |
11 % EXAMPLES: GPS_time=GPS2UTC(711129613) | |
12 % GPS_time='2002-07-19 16:00:00' | |
13 % | |
14 % VERSION: $Id: gps2utc.m,v 1.2 2010/02/01 15:35:10 ingo Exp $ | |
15 % | |
16 % HISTORY: xx-xx-xxxx Karsten Koetter | |
17 % Creation | |
18 % 24-01-2007 M Hewitson. | |
19 % Maintained | |
20 % | |
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
22 | |
23 function UTC_time = gps2utc(GPS_time) | |
24 | |
25 leapSecond = 15; | |
26 | |
27 GPS_Epoch=datenum('01-06-1980 00:00:00')*86400; | |
28 NUM_time=GPS_Epoch+GPS_time-leapSecond; | |
29 | |
30 UTC_time=datestr(NUM_time/86400,31); | |
31 | |
32 end | |
33 | |
34 |