You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the datetime library uses, and surely the reason its author created it, is to deal with time stamps.
Time stamps can be used in many ways, but two can be considered prominent:
Labelling some data gathered by an automatic device with the time instant it was actually read.
Assigning a time-dependent file name for collecting time-labelled data.
The second of these uses involves truncation/rounding of times to appropriate averaging intervals, for example one hour, or one day, or ten minutes.
This is simple to accomplish on epoch values: they're integer, and the operations mentioned can be implemented using integer arithmetics.
Time values can then be obtained using appropriate conversion functions, but this requires few code lines when one would be simpler and easier to read.
The truncation operator could be delivered with an operator interface, with a syntax like
tTruncated = tTime .time_clip. DTM_ONE_HOUR
where DTM_ONE_HOUR is a public parameter indicating an hour. Other common public parameters could be used as well (I know the author would appreciate any divisor of 3600 between 60 and 3600; the operator should work in any case whatever the integer value of its right argument).
The text was updated successfully, but these errors were encountered:
One of the
datetime
library uses, and surely the reason its author created it, is to deal with time stamps.Time stamps can be used in many ways, but two can be considered prominent:
The second of these uses involves truncation/rounding of times to appropriate averaging intervals, for example one hour, or one day, or ten minutes.
This is simple to accomplish on epoch values: they're integer, and the operations mentioned can be implemented using integer arithmetics.
Time values can then be obtained using appropriate conversion functions, but this requires few code lines when one would be simpler and easier to read.
The truncation operator could be delivered with an operator interface, with a syntax like
where DTM_ONE_HOUR is a public parameter indicating an hour. Other common public parameters could be used as well (I know the author would appreciate any divisor of 3600 between 60 and 3600; the operator should work in any case whatever the integer value of its right argument).
The text was updated successfully, but these errors were encountered: