Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Michael . VanCanneyt
On Wed, 29 Sep 2004, Jilani Khaldi wrote: > > Or, simpler, use DecodeDateTime function from DateUtils unit. It's > even Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x > (even if not, it's probably > > possible to just compile DateUtils unit sources from FPC 1.9.4 using > FPC

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Jilani Khaldi
>It's a lot simpler to use simply SysUtils.DecodeDate and DeccdeTime. Uses SysUtils; var Year, Month, Day, hour,minute,second,msec : word; begin decodedate(trunc(thetdatetime),year,month,day); decodetime(frac(thetdatetime),hour,minute,second,msec); end; Well, I want to use the double value as

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Jilani Khaldi
> Or, simpler, use DecodeDateTime function from DateUtils unit. It's even Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x (even if not, it's probably > possible to just compile DateUtils unit sources from FPC 1.9.4 using FPC 1.0.10), but it exists in FPC 1.9.x for sure. I know I c

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Marco van de Voort
> > Or you might scan the strings created by DateToStr. That'd be > > quick-n-dirty, though :-) > > > > Anton. > > > > Or, simpler, use DecodeDateTime function from DateUtils unit. It's even > Delphi-compatible. I'm not sure whether it exists in FPC 1.0.x (even if > not, it's probably possibl

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Michael . VanCanneyt
On Wed, 29 Sep 2004, Anton Tichawa wrote: > Michael Van Canneyt wrote: > > >On Wed, 29 Sep 2004, Jilani Khaldi wrote: > > > > > > > >>Hi All, > >>Does somebody kown the algorithm to convert a date from the double > >>format to an explicit format? > >>Example: the function "now" givers me: 3.

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Michalis Kamburelis
Anton Tichawa wrote: Michael Van Canneyt wrote: On Wed, 29 Sep 2004, Jilani Khaldi wrote: Hi All, Does somebody kown the algorithm to convert a date from the double format to an explicit format? Example: the function "now" givers me: 3.825956615197917E+004 I want to transform it in: year-month-

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Marco van de Voort
> Michael Van Canneyt wrote: > > > > > > Or, if you need the values for some sort of calculation, you have to > > - find out the reference date, i. e. DateToStr(0) > - and the scale, (I think 1.0 = 1 day) > - consider the month lengths, with february changing in leap years > - for historic date

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Anton Tichawa
Michael Van Canneyt wrote: On Wed, 29 Sep 2004, Jilani Khaldi wrote: Hi All, Does somebody kown the algorithm to convert a date from the double format to an explicit format? Example: the function "now" givers me: 3.825956615197917E+004 I want to transform it in: year-month-day Why not

Re: [fpc-pascal] Explicit date from double format

2004-09-29 Thread Michael Van Canneyt
On Wed, 29 Sep 2004, Jilani Khaldi wrote: > Hi All, > Does somebody kown the algorithm to convert a date from the double > format to an explicit format? > Example: the function "now" givers me: 3.825956615197917E+004 > I want to transform it in: year-month-day Why not use DateToStr() or F

[fpc-pascal] Explicit date from double format

2004-09-29 Thread Jilani Khaldi
Hi All, Does somebody kown the algorithm to convert a date from the double format to an explicit format? Example: the function "now" givers me: 3.825956615197917E+004 I want to transform it in: year-month-day Thanks! Jilani ___ fpc-pascal maillist