Skip to content

Commit

Permalink
Ready for release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hollasch committed May 24, 2018
1 parent 32cec6d commit 0bac465
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 57 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Change Log for `timeprint`
================================================================================

## v2.1.0 (In Progress)
## v2.1.0 (2018-05-24)
- Indicate unknown DST status for calls to mktime().
- Print error message for unhandled explicit dates before 1970.
- Handle numeric prefix on %a format codes.
- New: Handle numeric prefix on %a format codes.

## v2.0.0 (2018-02-26)
- Renamed from currtime to timeprint.
Expand Down
9 changes: 5 additions & 4 deletions test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ call :test Percent sign = %%%%%%%%
call :test Bogus codes: %%%%E%%%%f%%%%i%%%%J%%%%N%%%%P%%%%s%%%%v
call :test Bogus codes: %%%%_a %%%%_z

call :test --timezone UTC --time 2000-01-01T00:00:00Z
call :test --timezone UTC --time 2000-01-02T03:04:05+67
call :test --timezone UTC --time 2000-01-02T03:04:05-67:89
call :test --timezone UTC --time 2000-01-02T03:04:05-6789
call :test --timezone UTC --time 2000-01-01T00:00:00Z
call :test --timezone UTC --time 2000-01-02T03:04:05+67
call :test --timezone UTC --time 2000-01-02T03:04:05-67:89
call :test --timezone UTC --time 2000-01-02T03:04:05-6789
call :test --timezone UTC --time 2000-01-01T12:00Z "%%%%1a %%%%2a %%%%3a %%%%4a %%%%5a %%%%6a %%%%7a %%%%8a %%%%9a %%%%20a"
call :test --timezone PST+08 --time 2000-01-01T00:00:00Z "%%%%#c %%%%z %%%%Z"

call :test --time 2000-01-01T00:00:00Z --time 2000-01-02T00:00:00Z "%%%%_S"
Expand Down
21 changes: 11 additions & 10 deletions tests-accepted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Acceptance Tests for `timeprint`

--------------------------------------------------------------------------------
Test 1: [/?]
timeprint v2.0.0 | https://github.com/hollasch/timeprint

timeprint v2.1.0 | https://github.com/hollasch/timeprint
timeprint - Print time and date information

usage: timeprint [--codeChar <char>] [-%<char>]
Expand Down Expand Up @@ -87,13 +88,13 @@ For additional help, use `--help <topic>`, where <topic> is one of:
--------------------------------------------------------------------------------
[--help FORMATCODES]


Format Codes
--------------

The following time format codes are supported:

%a Abbreviated weekday name *
%<d>a Weekday name, abbreviated to d characters (min 1)
%A Full weekday name *
%b Abbreviated month name *
%B Full month name *
Expand Down Expand Up @@ -155,7 +156,6 @@ For additional help, use `--help <topic>`, where <topic> is one of:
--------------------------------------------------------------------------------
[-H timeSyntax]


Time Syntax
-------------

Expand Down Expand Up @@ -212,9 +212,9 @@ For additional help, use `--help <topic>`, where <topic> is one of:
--------------------------------------------------------------------------------
[/htimezone]


Time Zones
------------

The time zone value may be specified with the TZ environment variable,
or using the `--timezone` option. Time zones have the format
`tzn[+|-]hh[:mm[:ss]][dzn]`, where
Expand Down Expand Up @@ -256,7 +256,6 @@ For additional help, use `--help <topic>`, where <topic> is one of:
--------------------------------------------------------------------------------
[--help examples]


Examples
----------

Expand All @@ -282,7 +281,6 @@ For additional help, use `--help <topic>`, where <topic> is one of:
--------------------------------------------------------------------------------
[--help deltaTime]


Delta Time Formatting
-----------------------

Expand Down Expand Up @@ -477,18 +475,21 @@ Bogus codes: %E%f%i%J%N%P%s%v
[Bogus codes: %_a %_z]
Bogus codes: %_a %_z
--------------------------------------------------------------------------------
[--timezone UTC --time 2000-01-01T00:00:00Z]
[--timezone UTC --time 2000-01-01T00:00:00Z]
Saturday, January 01, 2000 00:00:00
--------------------------------------------------------------------------------
[--timezone UTC --time 2000-01-02T03:04:05+67]
[--timezone UTC --time 2000-01-02T03:04:05+67]
Thursday, December 30, 1999 08:04:05
--------------------------------------------------------------------------------
[--timezone UTC --time 2000-01-02T03:04:05-67:89]
[--timezone UTC --time 2000-01-02T03:04:05-67:89]
Tuesday, January 04, 2000 23:33:05
--------------------------------------------------------------------------------
[--timezone UTC --time 2000-01-02T03:04:05-6789]
[--timezone UTC --time 2000-01-02T03:04:05-6789]
Tuesday, January 04, 2000 23:33:05
--------------------------------------------------------------------------------
[--timezone UTC --time 2000-01-01T12:00Z "%1a %2a %3a %4a %5a %6a %7a %8a %9a %20a"]
S Sa Sat Satu Satur Saturd Saturda Saturday Saturday Saturday
--------------------------------------------------------------------------------
[--timezone PST+08 --time 2000-01-01T00:00:00Z "%#c %z %Z"]
Friday, December 31, 1999 16:00:00 -0800 PST
--------------------------------------------------------------------------------
Expand Down
82 changes: 41 additions & 41 deletions timeprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ bool printDeltaFunc (

//__________________________________________________________________________________________________
static auto help_general = LR"(
timeprint v2.1.0-beta | https://github.com/hollasch/timeprint
timeprint v2.1.0 | https://github.com/hollasch/timeprint
timeprint - Print time and date information
usage: timeprint [--codeChar <char>] [-%<char>]
Expand Down Expand Up @@ -1078,46 +1078,46 @@ static auto help_formatCodes = LR"(
The following time format codes are supported:
%a Abbreviated weekday name *
%<d>a Weekday name, abbreviated to d characters (min 1)
%A Full weekday name *
%b Abbreviated month name *
%B Full month name *
%c Date and time representation *
%C Year divided by 100 and truncated to integer (00-99)
%d Day of month as decimal number (01-31)
%D Short MM/DD/YY date, equivalent to %m/%d/%y
%e Day of the month, space-padded ( 1-31)
%F Short YYYY-MM-DD date, equivalent to %Y-%m-%d
%g Week-based year, last two digits (00-99)
%G Week-based year
%h Abbreviated month name (same as %b) *
%H Hour in 24-hour format (00-23)
%I Hour in 12-hour format (01-12)
%j Day of year as decimal number (001-366)
%m Month as decimal number (01-12)
%M Minute as decimal number (00-59)
%n New line character (same as '\n')
%p AM or PM designation
%r 12-hour clock time *
%R 24-hour HH:MM time, equivalent to %H:%M
%S Seconds as a decimal number (00-59)
%t Horizontal tab character (same as '\t')
%T ISO 8601 time format (HH:MM:SS) equivalent to %H:%M:%S
%u ISO 8601 weekday as number with Monday=1 (1-7)
%U Week number, first Sunday = week 1 day 1 (00-53)
%V ISO 8601 week number (01-53)
%w Weekday as decimal number, Sunday = 0 (0-6)
%W Week of year, decimal, Monday = week 1 day 1(00-51)
%x Date representation *
%X Time representation *
%y Year without century, as decimal number (00-99)
%Y Year with century, as decimal number
%z ISO 8601 offset from UTC in timezone (1 minute=1, 1 hour=100)
If timezone cannot be determined, no characters
%Z Time-zone name or abbreviation, empty for unrecognized zones *
%_... Delta time formats. See `--help deltaTime`.
%% Percent sign
%a Abbreviated weekday name *
%<d>a Weekday name, abbreviated to d characters (min 1)
%A Full weekday name *
%b Abbreviated month name *
%B Full month name *
%c Date and time representation *
%C Year divided by 100 and truncated to integer (00-99)
%d Day of month as decimal number (01-31)
%D Short MM/DD/YY date, equivalent to %m/%d/%y
%e Day of the month, space-padded ( 1-31)
%F Short YYYY-MM-DD date, equivalent to %Y-%m-%d
%g Week-based year, last two digits (00-99)
%G Week-based year
%h Abbreviated month name (same as %b) *
%H Hour in 24-hour format (00-23)
%I Hour in 12-hour format (01-12)
%j Day of year as decimal number (001-366)
%m Month as decimal number (01-12)
%M Minute as decimal number (00-59)
%n New line character (same as '\n')
%p AM or PM designation
%r 12-hour clock time *
%R 24-hour HH:MM time, equivalent to %H:%M
%S Seconds as a decimal number (00-59)
%t Horizontal tab character (same as '\t')
%T ISO 8601 time format (HH:MM:SS) equivalent to %H:%M:%S
%u ISO 8601 weekday as number with Monday=1 (1-7)
%U Week number, first Sunday = week 1 day 1 (00-53)
%V ISO 8601 week number (01-53)
%w Weekday as decimal number, Sunday = 0 (0-6)
%W Week of year, decimal, Monday = week 1 day 1(00-51)
%x Date representation *
%X Time representation *
%y Year without century, as decimal number (00-99)
%Y Year with century, as decimal number
%z ISO 8601 offset from UTC in timezone (1 minute=1, 1 hour=100)
If timezone cannot be determined, no characters
%Z Time-zone name or abbreviation, empty for unrecognized zones *
%_... Delta time formats. See `--help deltaTime`.
%% Percent sign
* Specifiers marked with an asterisk are locale-dependent.
Expand Down

0 comments on commit 0bac465

Please sign in to comment.