set_taxis

Function datenum2long

  Convert Matlab datenum to date with format yyyymmdd, 
  time with format HHmm and time with format HHMMSS.
 
  

CALL:

   [Date, Time, LongTime] = datenum2long(D, timeunit)
 
  

INPUT:

   D: Scalar, vector or matrix with datenum data.
   timeunit: Optional argument with possible values:
             - 'mnd': Donar uses different format for months.
             - otherwise: Use standard Donar date format.
  
  

OUTPUT:

   Date:     Corresponding date(s) in yyyymmdd.
   Time:     Corresponding time(s) in HHMM.
   LongTime: Corresponding time(s) in HHMMSS.
 
  

EXAMPLE:

   [Date, Time] = datenum2long(now)
Date =
    20111206
Time =
   345

APPROACH:

   Round D to whole minutes:
   - Add 30 seconds to D and call datevec.
   - Ignore 'second' output argument.
  
  

NOTE:

   .m source of this function is used in mwritedia.c.
  
  

See also:

long2datenum