1. Help for the Date() format

Hi to everybody from a newcomer...

I have the need the read the system's date in  a 4-digit format.
Euphoria's Date() returns only the last two digit of the year...
Any suggestions? (Please don't tell me to just add "19" in front... :)

Thanks in advance!

Matt

new topic     » topic index » view message » categorize

2. Re: Help for the Date() format

Matt wrote:

> Hi to everybody from a newcomer...
>
> I have the need the read the system's date in  a 4-digit format.
> Euphoria's Date() returns only the last two digit of the year...
> Any suggestions? (Please don't tell me to just add "19" in front... :)
>
> Thanks in advance!
>
> Matt

After 1999, the date() routine will return 100, 101, 102, etc,
(meaning 2000, 2001, 2002, etc)

DOS wasn't supposed to last this long, you know...

Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: Help for the Date() format

Matt writes:
> I have the need the read the system's date in  a 4-digit format.
> Euphoria's Date() returns only the last two digit of the year...
> Any suggestions? (Please don't tell me to just add "19" in front... :)

Euphoria's date() routine returns the year *since 1900* in element 1.
You should add 1900 to get the 4-digit year. Don't just stick
"19" in front or you'll have problems in the year 2000.

-- correct way of printing 4-digit year:
sequence s
s = date()
?s[1] + 1900

I set my system date temporarily to 2005, and date() returned
105 in element 1.

105 + 1900 = 2005, which is correct.

Regards,
  Rob Craig
  Rapid Deployment Software

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu