C Library Functions - fmtdate (3)
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 (3) | June 29, 2025 |
Generated by manServer 1.08 from 2cebb2b3-6d33-487e-83e2-efb5af92673f using man macros.