Menu

#603 timeformat() and to_time() shall support ms and µs

v1.1.x
closed
strings (14)
v1.1.4
Change Request
2022-01-18
2021-07-27
Erik Hänel
No

The two string functions timeformat() and to_time() shall support milli- and microseconds as well. Use the characters from here for identification: https://www.php.net/manual/en/datetime.format.php

Analysis:

The corresponding code section is located in \kernel\core\strings\stringfunctions.hpp. Update the function strfnc_to_time to support the new date types. Note that the used tm timeStruct does not support milli- and microseconds, so you have to parse and add them manually (also consider the case, that somebody might have milli- or microseconds, which are much more than 1s in total).

The function timeformat() cannot be updated in this way (due to the fact that the argument is an integer and not a float). We'll drop that for now.

For documentation reach out to numere-lang/de-DE/main.nlng and update the documentation for PARSERFUNCS_LISTFUNC_FUNC_TO_TIME_[TIME_STRING] with the new argument types. Do the same for the corresponding id in en-GB/main.nlng

Implementation:

  • Implementation: Both functions are now supporting milli- and microseconds via the characters "i" and "u".
  • Revision: [r1021]
  • Implementation test: Successful conversions from time stamps to value and back were performed.

Documentation:

  • ChangesLog updated
  • Code changes commented
  • Documentation articles:
    • corresponding documentation articles updated
    • new documentation articles created
    • not needed
  • Language files:
    • corresponding language files updated
    • not needed

Tests:

Change was added to the automatic SW tests. Occured deviation was fixed.

Related

Commit: [r1021]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-07-28
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-07-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,23 @@
     The two string functions `timeformat()` and `to_time()` shall support milli- and microseconds as well.  Use the characters from here for identification: https://www.php.net/manual/en/datetime.format.php
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-07-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,11 @@
     The two string functions `timeformat()` and `to_time()` shall support milli- and microseconds as well.  Use the characters from here for identification: https://www.php.net/manual/en/datetime.format.php
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +he corresponding code section is located in `\kernel\core\strings\stringfunctions.hpp`. Update the function `strfnc_to_time` to support the new date types. Note that the used `tm timeStruct` does not support milli- and microseconds, so you have to parse and add them manually (also consider the case, that somebody might have milli- or microseconds, which are much more than 1s in total).
    +
    +The function `timeformat()` cannot be updated in this way (due to the fact that the argument is an integer and not a float). We'll drop that for now.
    +
    +For documentation reach out to numere-lang/de-DE/main.nlng and update the documentation for `PARSERFUNCS_LISTFUNC_FUNC_TO_TIME_[TIME_STRING]` with the new argument types. Do the same for the corresponding id in en-GB/main.nlng
    
     ###Implementation:
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-07-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     The two string functions `timeformat()` and `to_time()` shall support milli- and microseconds as well.  Use the characters from here for identification: https://www.php.net/manual/en/datetime.format.php
    
     ###Analysis:
    -he corresponding code section is located in `\kernel\core\strings\stringfunctions.hpp`. Update the function `strfnc_to_time` to support the new date types. Note that the used `tm timeStruct` does not support milli- and microseconds, so you have to parse and add them manually (also consider the case, that somebody might have milli- or microseconds, which are much more than 1s in total).
    +The corresponding code section is located in `\kernel\core\strings\stringfunctions.hpp`. Update the function `strfnc_to_time` to support the new date types. Note that the used `tm timeStruct` does not support milli- and microseconds, so you have to parse and add them manually (also consider the case, that somebody might have milli- or microseconds, which are much more than 1s in total).
    
     The function `timeformat()` cannot be updated in this way (due to the fact that the argument is an integer and not a float). We'll drop that for now.
    
     
  • Erik Hänel

    Erik Hänel - 2021-08-18
    • labels: --> strings
     
  • Erik Hänel

    Erik Hänel - 2021-10-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,19 +8,19 @@
     For documentation reach out to numere-lang/de-DE/main.nlng and update the documentation for `PARSERFUNCS_LISTFUNC_FUNC_TO_TIME_[TIME_STRING]` with the new argument types. Do the same for the corresponding id in en-GB/main.nlng
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: Both functions are now supporting milli- and microseconds via the characters `"i"` and `"u"`.
    +* Revision: [r1021]
    +* Implementation test: Successful conversions from time stamps to value and back were performed.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
    -    * [ ] corresponding language files updated
    +    * [x] corresponding language files updated
         * [ ] not needed
    
     ###Tests:
    
    • status: implementing --> testing
     

    Related

    Commit: [r1021]

  • Erik Hänel

    Erik Hänel - 2022-01-18
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -24,4 +24,4 @@
         * [ ] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Change was added to the automatic SW tests. Occured deviation was fixed.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel