pvl_maketimestruct

Generate a time struct from MATLAB datenum and UTC offset code.

Contents

Syntax

Time = pvl_maketimestruct(datenum, UTC)

Description

Generates a time structure given a MATLAB datenum and UTC offset code. The time structure is used in some PV_LIB functions such as pvl_ephemeris. The time struct pairs a set of times with a UTC Offset code, such that any time can be converted to UTC.

Inputs

Outputs

Example 1

Create Time structure for a single date and time in Albuquerque, NM

Datenum = datenum('24-Oct-2003 12:45:07');
T = pvl_maketimestruct(Datenum,-7)
T = 

  struct with fields:

    UTCOffset: -7
         year: 2003
        month: 10
          day: 24
         hour: 12
       minute: 45
       second: 7

Example 2

Create Time structure for a single date and time in Greenwich, UK

Datenum = datenum('29-Feb-2012 19:15:00');
T = pvl_maketimestruct(Datenum,0)
T = 

  struct with fields:

    UTCOffset: 0
         year: 2012
        month: 2
          day: 29
         hour: 19
       minute: 15
       second: 0

See Also

pvl_ephemeris, pvl_exceltime2matlab

Copyright 2014 Sandia National Laboratories