[UP]


Manual Reference Pages  - now (1)

NAME

now(1f) - [TIME] print the date and time (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Limits
See Also
Author
License

SYNOPSIS

now [Format [ -date date_str|-ued Unix_time|-jed Julian_Date|-dat date_vector] [ -delta dd-hh:mm:ss]]|--help |--version|-test]

DESCRIPTION

Report the current time or a Fortran date vector in a variety of formats. Julian dates, Unix Epoch time, weekdays, monthnames, ordinal days, AM/PM and iso-8601 week-numbering are supported by building a format string containing the desired macros.

OPTIONS

Format This string, containing macro names or keywords, creates the format used to print the specified date.

The FORMAT string is expanded using the following macros:

      Description                                        Example

Base time array: (1) %Y -- year, yyyy 2019 (2) %M -- month of year, 01 to 12 11 (3) %D -- day of month, 01 to 31 28 %d -- day of month, with suffix (1st, 2nd,...) 28th (4) %Z -- minutes from UTC -0300 %z -- -+hh:mm from UTC -05:00 %T -- -+hhmm from UTC -0500 (5) %h -- hours, 00 to 23 20 %H -- hour (1 to 12, or twelve-hour clock) 8 %N -- midnight< AM <=noon; noon<= PM <midnight PM (6) %m -- minutes, 00 to 59 43 (7) %s -- sec, 00 to 59 17 (8) %x -- milliseconds 000 to 999 710 Conversions: %E -- Unix Epoch time 1574991797.7100163 %e -- integer value of Unix Epoch time 1574991798 %J -- Julian date 2458816.5717336112 %j -- integer value of Julian Date(Julian Day) 2458816 %O -- Ordinal day (day of year) 332 %o -- Whole days since Unix Epoch date 18229 %U -- day of week, 1..7 Sunday=1 5 %u -- day of week, 1..7 Monday=1 4 %i -- ISO week of year 1..53 48 %I -- iso-8601 week-numbering date(yyyy-Www-d) 2019-W48-4 Names: %l -- abbreviated month name Nov %L -- full month name November %w -- first three characters of weekday Thu %W -- weekday name Thursday %p -- phase of moon New %P -- percent of way from new to full moon 12% Literals: %% -- a literal % % %t -- tab character %b -- blank character %B -- exclamation(bang) character ! %n -- new line (system dependent)

%q -- single quote (apostrophe) ’ %Q -- double quote " Program timing: %c -- CPU_TIME(3f) output 0.31000000000000000E-001 %C -- number of times this routine is used 1 %S -- seconds since last use of this format 0.0000000000000000 %k -- time in seconds from SYSTEM_CLOCK(3f) 222508.281 %K -- time in clicks from SYSTEM_CLOCK(3f) 222508293

If no percent (%) is found in the format one of several alternate substitutions occurs.

If the format is composed entirely of one of the following keywords the following substitutions occur: "iso-8601", "iso" ==> %Y-%M-%DT%h:%m:%s%z 2019-11-28T20:43:17-05:00 "iso-8601W", "isoweek" ==> %I 2019-W48-4 "sql" ==> "%Y-%M-%D %h:%m:%s.%x" "2019-11-28 20:43:17.793" "sqlday" ==> "%Y-%M-%D" "2019-11-28" "sqltime" ==> "%h:%m:%s.%x" "20:43:17.794" "rfc-2822" ==> %w, %D %l %Y %h:%m:%s %T Thu, 28 Nov 2019 20:43:17 -0500 "rfc-3339" ==> %Y-%M-%DT%h:%m:%s%z 2019-11-28T20:43:17-05:00 "date" ==> %w %l %D %h:%m:%s UTC%z %Y Thu Nov 28 20:43:17 UTC-05:00 2019 "short" ==> %w, %l %d, %Y %H:%m:%s %N UTC%z Thu, Nov 28th, 2019 8:43:17 PM UTC-05:00 "long"," " ==> %W, %L %d, %Y %H:%m:%s %N UTC%z Thursday, November 28th, 2019 8:43:17 PM UTC-05:00 "suffix" ==> %Y%D%M%h%m%s 20192811204317 "formal" ==> The %d of %L %Y The 28th of November 2019 "lord" ==> the %d day of %L in the year of our Lord %Y the 28th day of November in the year of our Lord 2019 "easter" ==> FOR THE YEAR OF THE CURRENT DATE: Easter day: the %d day of %L in the year of our Lord %Y "all" ==> A SAMPLE OF DATE FORMATS otherwise the following words are replaced with the most common macros: year %Y 2019 month %M 11 day %D 28 timezone %z -05:00 hour %h 20 minute %m 43 second %s 17 millisecond %x 801 epoch %e 1574991798 julian %j 2458816 ordinal %O 332 weekday %u 4 if none of these keywords are found then every letter that is a macro is assumed to have an implied percent in front of it. For example: YMDhms ==> %Y%M%D%h%m%s ==> 20191128204317

-dat date_vector
  A date vector is eight integers representing a date in the same manner as the Fortran DATE_AND_TIME(3f) function: yyyy mm dd zone hh mm ss mss only numeric time zones are supported.

When present, the specified date is used instead of the current time.

-uet Unix_Epoch_Time
  When present a value is used as the Unix Epoch Time. This date is is then adjusted using any -delta value and then printed using the specified format.
-jed Julian_Date
  When present a value is used as the Julian Ephemeris Date.
-delta dd-hh:mm:ss
  Add the specified duration to the date.
-date date_str
  The guessdate(3f) routine is used to try to convert a date description to a date vector. For the guess to work, dates must either be in the form YYYY-MM-DD or the order of numeric values must be ""dd yy yyy". Only four-digit years are supported. Month names are preferred over numeric values. See the guessdate(3f) documentation for further details.
-test : To list allowed macros use the -test switch.

When present, the specified date is used instead of the current time.

EXAMPLES

Sample commands:

  now
    Friday, June 17th, 2016 03:22:53 PM UTC-4:00

now -delta 1-0:0:0 # Tomorrow Sunday, June 19th, 2016 11:32:26 AM UTC-4:00

now -delta -1-0:0:0 # Yesterday Friday, June 17th, 2016 11:32:43 AM UTC-4:00

now long -delta 7-0:0:0 # Next week Saturday, June 25th, 2016 11:32:57 AM UTC-04:00

now The date is %Y/%M/%D %h:%m:%s # user-specified formats using macros The date is 2009/08/10 00:33:48

now Y/M/D h:m:s # user-specified format with no % character 2009/08/10 00:33:48

now year-month-day # user-specified format with no % with long keywords 2016-07-29

now -dat 2016 07 23 -240 1 01 00 00 # alternate date Saturday, July 23rd, 2016 1:01:00 AM UTC-4:00

now -uet 1469250060 # alternate Unix Epoch date now -date January 4th, 1999 10:20:30 # try to determine date from description.

now YEAR=%Y MONTH=%M DAY=%D # YEAR=2009 MONTH=08 DAY=10

now HOUR=%h MINUTES=%m SECONDS=%s MILLISECONDS=%x HOUR=01 MINUTES=18 SECONDS=44 MILLISECONDS=946

# double-quotes are tricky (double them) to put in literally in this program: now ’""year-month-day"",""hour-minute-second""’ # "2017-04-23","14-41-09"

# quotes are easier to control using the single-letter macros(use %q and %Q): now QY-M-DQ,Qh:m:sQ "2017-04-23","14-41-09"

now -test # Show formatting options, handy way to look up macro names

LIMITS

See the M_time module description. Basically, A Gregorian Calendar is assumed, and Leap Seconds are not specifically accounted for.

SEE ALSO

month(1), sec2days(1), days2sec(1), easter(1), paws(1), today(1), ttee(1)

AUTHOR

John S. Urban

LICENSE

Public Domain


now (1) March 11, 2021
Generated by manServer 1.08 from eeee2aea-0703-44c9-8beb-539fa564cd18 using man macros.