I can find a territory-dependent version, which implies a conversion
error during either DST or non-DST; but I can't find a way either to
specify UTC input to Territory_ConvertOrdinalsToTime, or to do a
conversion that is inherently UTC-to-UTC.
If anyone knows the trick, please tell me what it is.
Dave
> daveh...@dsl.pipex.com wrote:
> > How can one convert UTC ordinals to a 5-byte UTC time?
>
> In platform-independant BBC BASIC, use PROCDate_FromOrd() in the
> Date library at http://mdfs.net/blib
>
> Convert time and date to 5-byte centi-second count
> ==================================================
> DEFPROCDate_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%)
>
> On entry: mem%->five bytes of memory
> day, month, year of the date
> hours, minutes, seconds, centiseconds of the time
> On exit: mem% to mem%+4 containes five-byte centisecond time since
> 00:00:00 on 1-Jan-1900.
>
> Example:
> DIM timebuf% 4
> PROCDate_FromOrd(timebuf%, 7,1,1969, 00,30,00,00)
>
> to get a certain personally interesting date-point.
OK, thanks for that.
> Otherwise, for a RISC OS-only solution, you can use SWI
> "Territory_ConvertOrdinalsToTime"
>
> DIM utc% 4
> DIM ord% 27
> ord%!0=centisecond
> ord%!4=seconds
> ord%!8=minutes
> ord%!12=hours
> ord%!16=day
> ord%!20=month
> ord%!24=year
> SYS "Territory_ConvertOrdinalsToTime", -1, utc%, ord%
>
> but as you say, that converts local time, not to UTC, so does DST/NODST
> conversion.
Yes. A curious omission from RISC OS. Worse than just DST/NODST,
if my app is used in a territory other than GMT or GMT - 1, the
above will add an even bigger error.
It would be neat if there were a Territory (perhaps 0?) representing
UTC, so that SYS "Territory_ConvertOrdinalsToTime" could be called
with that Territory and therefore always return the correct time.
Dave
How did you do it, you predict the Iyonix date BUG ?
Jean-Michel
--
Jean-Michel BRUCK
jmc....@orange.fr
Europ�en Computer : RISC OS ( Iyonix pc 5.13 & RiscPc (Select))
> How did you do it, you predict the Iyonix date BUG ?
Tardis, probably.
--
Jeremy C B Nicoll - my opinions are my own.
Email sent to my from-address will be deleted. Instead, please reply
to newsre...@wingsandbeaks.org.uk replacing "nnn" by "284".