Menu

#282 Add time formatting functions

v1.1.x
closed
None
v1.1.1
New Functionality
2018-03-01
2018-02-08
Erik Hänel
No

For enhancing the possibilities to analyze log files, the addition of time formatting functions would be helpful, i.e. add the two functions

to_time("TIME_FORMAT", "TIME") -> VAL
timeformat("TIME_FORMAT", TIMEVAL) -> STR

where "TIME_FORMAT" will contain the usual identifier chars yMdHms, where M means "month" and m means minute, and of course the used separators, e.g. yyyy-MM-dd HH:mm:ss.

Analysis:
The function to_time() will be classified as STR_STR type and timeformat() will be STR_VAL as type. The function to_time() will need the tm struct and the mktime() function from <ctime>. timeformat() can be implemented similar to the already available date() function.

Implementation:
The two functions were implemented as proposed by the analysis. Implementation tests were passed successfully.

Documentation:
The functions were added to the language files, to the syntax elements and to the find database.

Tests:
The functionality was added to the automatic tests. No deviations detected. Functionality implemented successfully.

Discussion

  • Erik Hänel

    Erik Hänel - 2018-02-08
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,3 +4,11 @@
         timeformat("TIME_FORMAT", TIMEVAL) -> STR
    
     where `"TIME_FORMAT"` will contain the usual identifier chars `yMdHms`, where `M` means "month" and `m` means minute, and of course the used separators, e.g. `yyyy-MM-dd HH:mm:ss`.
    +
    +**Analysis:**
    +
    +**Implementation:**
    +
    +**Documentation:**
    +
    +**Tests:**
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,6 +6,7 @@
     where `"TIME_FORMAT"` will contain the usual identifier chars `yMdHms`, where `M` means "month" and `m` means minute, and of course the used separators, e.g. `yyyy-MM-dd HH:mm:ss`.
    
     **Analysis:**
    +The function `to_time()` will be classified as `STR_STR` type and `timeformat()` will be `STR_VAL` as type. The function `to_time()` will need the `tm struct` and the `mktime()` function from `<ctime>`. `timeformat()` can be implemented similar to the already available `date()` function.
    
     **Implementation:**
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2018-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,7 +9,9 @@
     The function `to_time()` will be classified as `STR_STR` type and `timeformat()` will be `STR_VAL` as type. The function `to_time()` will need the `tm struct` and the `mktime()` function from `<ctime>`. `timeformat()` can be implemented similar to the already available `date()` function.
    
     **Implementation:**
    +The two functions were implemented as proposed by the analysis. Implementation tests were passed successfully.
    
     **Documentation:**
    +The functions were added to the language files, to the syntax elements and to the find database.
    
     **Tests:**
    
    • status: implementing --> testing
     
  • Erik Hänel

    Erik Hänel - 2018-03-01
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -15,3 +15,4 @@
     The functions were added to the language files, to the syntax elements and to the find database.
    
     **Tests:**
    +The functionality was added to the automatic tests. No deviations detected. Functionality implemented successfully.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB