A
Andrew Poulos
How do I convert a length of time, measured in seconds, into a "point in
time" type time interval or what's represented as: time (second,10,2)
The format is:
P[yY][mM][dD][T[hH][mM][s[.s]S]] where:
y: The number of years (integer, >= 0, not restricted)
m: The number of months (integer, >=0, not restricted)
d: The number of days (integer, >=0, not restricted)
h: The number of hours (integer, >=0, not restricted)
n: The number of minutes (integer, >=0, not restricted)
s: The number of seconds or fraction of seconds (real or integer, >=0,
not restricted). If fractions of a second are used, SCORM further
restricts the string to a maximum of 2 digits (e.g., 34.45 – valid,
34.45454545 – not valid).
The character literals designators “P”,”Y”,”M”,”D”,”T”,”H”,”M”,”S” shall
appear if the corresponding non-zero value is present.
Example:
P1Y3M2DT3H indicates a period of time of 1 year, 3 months, 2 days and 3
hours
PT3H5M indicates a period of time of 3 hours and 5 minutes
It's used by the SCORM RTE to measure the length of session times.
I've had a few goes but the code starts to look like spaghetti then I
have to give up.
Andrew Poulos
time" type time interval or what's represented as: time (second,10,2)
The format is:
P[yY][mM][dD][T[hH][mM][s[.s]S]] where:
y: The number of years (integer, >= 0, not restricted)
m: The number of months (integer, >=0, not restricted)
d: The number of days (integer, >=0, not restricted)
h: The number of hours (integer, >=0, not restricted)
n: The number of minutes (integer, >=0, not restricted)
s: The number of seconds or fraction of seconds (real or integer, >=0,
not restricted). If fractions of a second are used, SCORM further
restricts the string to a maximum of 2 digits (e.g., 34.45 – valid,
34.45454545 – not valid).
The character literals designators “P”,”Y”,”M”,”D”,”T”,”H”,”M”,”S” shall
appear if the corresponding non-zero value is present.
Example:
P1Y3M2DT3H indicates a period of time of 1 year, 3 months, 2 days and 3
hours
PT3H5M indicates a period of time of 3 hours and 5 minutes
It's used by the SCORM RTE to measure the length of session times.
I've had a few goes but the code starts to look like spaghetti then I
have to give up.
Andrew Poulos