bugGforth - Bugs: bug #61212, feature request: split out...

 
 

bug #61212: feature request: split out time&date to read and convert the time

Submitted by:  paul r <phr>
Submitted on:  Thu 23 Sep 2021 09:13:15 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  Bernd Paysan <paysan>
Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 23 Sep 2021 11:38:33 PM UTC, comment #2: 

Sounds ok, though the documentation should describe the um/mod conversion.  Right now the docs also don't mention ntime.

paul r <phr>
Thu 23 Sep 2021 11:35:13 PM UTC, comment #1: 

original submission:

> Currently there is a time&date word that reads the current time from the system, and splits it out into s m h D M Y.  I request splitting out the conversion part to convert an arbitrary timestamp as returned from utime:
>
> : convert-to-time&date ( utime -- s m h D M Y ) ... ;
> : date&time ( -- s m h D M Y ) utime convert-to-time&date ;
>
> The existing date&time still operates the same way to preserve compatibility, but the conversion part is made visible for users.


Looks like a good idea to make that binding to localtime more useful, yes.  I think it's ok to take seconds (localtime is only in second resolution), since you could have used utime or ntime (µs or ns as resolution) in the first place, and a simple um/mod helps you to convert that into µs and seconds or ns and seconds.

Bernd Paysan <paysan>
Project AdministratorIn charge of this item.
Thu 23 Sep 2021 09:13:15 PM UTC, original submission:  

Currently there is a time&date word that reads the current time from the system, and splits it out into s m h D M Y.  I request splitting out the conversion part to convert an arbitrary timestamp as returned from utime:

: convert-to-time&date ( utime -- s m h D M Y ) ... ;
: date&time ( -- s m h D M Y ) utime convert-to-time&date ;

The existing date&time still operates the same way to preserve compatibility, but the conversion part is made visible for users.

Thanks -- Paul

paul r <phr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51956:  clock.fs added by phr (2KiB - application/octet-stream - slightly refactored version of above)
file #51955:  clock.fs added by phr (2KiB - application/octet-stream - sample application, that would be simplified with this patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by paysan (Posted a comment)
  • -email is unavailable- added by phr (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-09-24 phr Attached File- => Added clock.fs, #51956
    2021-09-23 phr Attached File- => Added clock.fs, #51955
    2021-09-23 paysan StatusNone => In Progress
        Assigned toNone => paysan

    Back to the top


    Powered by Savane 3.7