TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Erik Wachtmeester
from: Klaus Meinhard
date: 1999-01-17 17:52:26
subject: Y2K.BTM

Hallo Erik, 

 EW> Delphi has a function FormatDateTime('yyyy-mm-dd hh:nn:ss',).
 EW> Has anyone written something like that for 4DOS? If yes, what does it
 EW> look like?

Not as a readymade function (though some day there may be if Rex Conn or
somebody from JP-Software is still reading this echo). You'll could write
it as a btm or subroutine. 

First you'll have to convert your date/time combination to seconds like this:

    set start=%{at}eval[%{at}date[%_date]*86400+%{at}time[%_time]]

(one line). {at}date converts to days since since 01.01.1980, 86400 is the
number of seconds in a day, {at}time gives you number of seconds since 00:00.
%_date and %_time are the current values, but can take every other valid
value.

You can now compute any date/time combination by adding/subtracting the
proper amount of seconds and convert back to new date and time with

 :: Get date and time by reverse calculation:
    set ndate=%{at}makedate[%{at}eval[%start \ 86400]]
    set ntime=%{at}maketime[%{at}eval[%start %% 86400]]

Using the little btm I posted a few days ago to find the proper input date
format for your country code and a little parsing of the input string
you'll get what you want.

Ostrhauderfehn, 17. Januar 1999, 17:52:27

*Klaus Meinhard*

--- WP/95 Rel 1.5CM (194.0) Reg.
* Origin: ERROR reading FAT table! Try the SKINNY one (Y/N)? (2:2449/236.1005)
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/50 252
@PATH: 2449/236 200 150 24/888 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.