Manual Reference Pages  - fmtdate (3m_time)

NAME

fmtdate(3f) - [M_time:DATE_PRINTING] given DAT date-time array return date as string using specified format (LICENSE:MIT)

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

function fmtdate(values,format) result(timestr)

    integer,dimension(8),intent(in)      :: values
    character(len=*),intent(in),optional :: format
    character(len=:),allocatable         :: timestr

DESCRIPTION

The fmtdate(3f) procedure lets you reformat a DAT array in many common formats using a special string containing macro names beginning with ’%’. To see the allowable macros call or see the fmtdate_usage(3f) routine.

OPTIONS

values date in a "DAT" array, which is the same format as the values returned by the intrinsic DATE_AND_TIME(3f):
                dat=[ year,month,day,timezone,hour,&
                 & minutes,seconds,milliseconds]

format string describing how to format the "DAT" array. For a complete description of the formatting macros supported see fmtdate_usage(3f).

RETURNS

timestr
  formatted output string representing date

EXAMPLE

Sample program:

    program demo_fmtdate
    use M_time, only : fmtdate
    implicit none
    integer :: dat(8)
       call date_and_time(values=dat)
       write(*,*)fmtdate(dat,"current date: %w, %l %d, %Y %H:%m:%s %N")
    end program demo_fmtdate

results:

      The current date is Sun, Jul 17th, 2016 01:21:35 PM

AUTHOR

John S. Urban, 2015-12-19

LICENSE

    MIT


Nemo Release 3.1 fmtdate (3m_time) August 31, 2024
Generated by manServer 1.08 from b4818af4-4e7e-4591-9b19-fbbaa3321b73 using man macros.