posixtime2utc

PURPOSE ^

POSIXTIME2UTC Convert POSIX time to corresponding serial date number in UTC.

SYNOPSIS ^

function d = posixtime2utc(s)

DESCRIPTION ^

POSIXTIME2UTC  Convert POSIX time to corresponding serial date number in UTC.

  Syntax:
    D = POSIXTIME2UTC(S)

  Description:
    D = POSIXTIME2UTC(S) returns the serial date numbers D corresponding
    to the POSIX times in scalar, vector or array S, using the straight 
    forward method (see note below).

  Notes:
    This function provides a compatibility interface for MATLAB and Octave,
    computing the conversion using a straight forward linear scaling:
      D = 719529 + S / 86400
    This is consistent with the POSIX specification (not counting leap seconds,
    using the same value for a leap second and its successor).

  Examples:
    % Get the current UTC time.
    d = posixtime2utc(posixtime())
    datestr(d)
    % Built-in functions return always local time.
    datestr(now())

  See also:
    POSIXTIME
    UTC2POSIXTIME

  Authors:
    Joan Pau Beltran  <joanpau.beltran@socib.cat>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

posixtime2utc.m

SOURCE CODE ^

0001 function d = posixtime2utc(s)
0002 %POSIXTIME2UTC  Convert POSIX time to corresponding serial date number in UTC.
0003 %
0004 %  Syntax:
0005 %    D = POSIXTIME2UTC(S)
0006 %
0007 %  Description:
0008 %    D = POSIXTIME2UTC(S) returns the serial date numbers D corresponding
0009 %    to the POSIX times in scalar, vector or array S, using the straight
0010 %    forward method (see note below).
0011 %
0012 %  Notes:
0013 %    This function provides a compatibility interface for MATLAB and Octave,
0014 %    computing the conversion using a straight forward linear scaling:
0015 %      D = 719529 + S / 86400
0016 %    This is consistent with the POSIX specification (not counting leap seconds,
0017 %    using the same value for a leap second and its successor).
0018 %
0019 %  Examples:
0020 %    % Get the current UTC time.
0021 %    d = posixtime2utc(posixtime())
0022 %    datestr(d)
0023 %    % Built-in functions return always local time.
0024 %    datestr(now())
0025 %
0026 %  See also:
0027 %    POSIXTIME
0028 %    UTC2POSIXTIME
0029 %
0030 %  Authors:
0031 %    Joan Pau Beltran  <joanpau.beltran@socib.cat>
0032 
0033 %  Copyright (C) 2013-2016
0034 %  ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
0035 %  <http://www.socib.es>
0036 %
0037 %  This program is free software: you can redistribute it and/or modify
0038 %  it under the terms of the GNU General Public License as published by
0039 %  the Free Software Foundation, either version 3 of the License, or
0040 %  (at your option) any later version.
0041 %
0042 %  This program is distributed in the hope that it will be useful,
0043 %  but WITHOUT ANY WARRANTY; without even the implied warranty of
0044 %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0045 %  GNU General Public License for more details.
0046 %
0047 %  You should have received a copy of the GNU General Public License
0048 %  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0049 
0050   error(nargchk(1, 1, nargin, 'struct'));
0051   
0052   d = 719529 + s / 86400;
0053   
0054 end

Generated on Fri 06-Oct-2017 10:47:42 by m2html © 2005