Board index » delphi » searching a routine to convert system date number in common format

searching a routine to convert system date number in common format

Hello,

I'm searching a routine to convert a system date number (number of days
since 31th december 1899) in a normal format (mm/dd/yy or something like
that) written in basic or pascal.

Thanks

 

Re:searching a routine to convert system date number in common format


In article <334B88C2.3...@unicall.be> of Wed, 9 Apr 1997 14:17:06 in
comp.lang.pascal.misc, Utilisateur 1 <ieps....@unicall.be> wrote:

Quote
>I'm searching a routine to convert a system date number (number of days
>since 31th december 1899) in a normal format (mm/dd/yy or something like
>that) written in basic or pascal.

When you've found it, check it against programs/mjd_test.pas at the URL
below - and if it's right & good, I'd like a copy, if it is in
TurboPascal (you posted in misc).

--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web URL: http://www.merlyn.demon.co.uk/ -- includes FAQqish topics and links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)

Re:searching a routine to convert system date number in common format


On Wed, 09 Apr 1997 14:17:06 +0200, Utilisateur 1

Quote
<ieps....@unicall.be> wrote:
>Hello,

>I'm searching a routine to convert a system date number (number of days
>since 31th december 1899) in a normal format (mm/dd/yy or something like
>that) written in basic or pascal.

>Thanks

It's probably a lot simpler to convert your date number to a Julian
day number (day 1 is Jan 1, 4713 B.C.), and then reconvert it back to
a normal format. The procedures for this are to be found in:-
Turbo Pascal Program Library, by Rugg and Feldman, published by QUE
Corp. ISBN 0-88022-244-1.

Frank Wood
wood...@dircon.co.uk

Re:searching a routine to convert system date number in common format


On Wed, 09 Apr 1997 14:17:06 +0200, Utilisateur 1

Quote
<ieps....@unicall.be> wrote:
>Hello,

>I'm searching a routine to convert a system date number (number of days
>since 31th december 1899) in a normal format (mm/dd/yy or something like
>that) written in basic or pascal.

>Thanks

It's probably a lot simpler to convert your date number to a Julian
day number (day 1 is Jan 1, 4713 B.C.), and then reconvert it back to
a normal format. The procedures for this are to be found in:-
Turbo Pascal Program Library, by Rugg and Feldman, published by QUE
Corp. ISBN 0-88022-244-1.

Frank Wood
wood...@dircon.co.uk

Re:searching a routine to convert system date number in common format


In article <335fed20.3607...@news.dircon.co.uk> of Thu, 24 Apr 1997
23:30:49 in comp.lang.pascal.misc, Frank Wood <wood...@dircon.co.uk>
wrote:

Quote
>It's probably a lot simpler to convert your date number to a Julian
>day number (day 1 is Jan 1, 4713 B.C.), and then reconvert it back to
>a normal format. The procedures for this are to be found in:-
>Turbo Pascal Program Library, by Rugg and Feldman, published by QUE
>Corp. ISBN 0-88022-244-1.

JD0 is (was?) NOON GMT BC 4713/01/01 until NOON the following day - I'm
reasonably sure that I mean JD0, not JD1, but I'm quite sure about the
NOON.  Anything dealing with JD that does not recognise the odd half day
is suspect (except in NZ & Kamchatka, maybe).

I suggest that, as the questioner's dates start in 1899, that it would
be better to use MJD - JD-2400000.5; I have a date->MJD routine in
programs/mjd_test.pas at the URL below - it assumes the date to be GMT.

From miscinfo.htm at the URL below :
    JD 0 started at noon GMT on 1 Jan 4713 BC, perhaps a Tuesday?.
    JD nowadays changes at noon UTC.
    Modified Julian Date : MJD = JD - 2400000.5.
    MJD 0 started at 0000h on 17 Nov 1858 AD, and was, I think, a
            Wednesday.
    MJD 50000 was Tuesday 10 Oct 1995, UTC.

--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web URL: http://www.merlyn.demon.co.uk/ -- includes FAQqish topics and links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)

Other Threads