forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IDATE routine: millenium bug?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Wed Jun 07, 2006 7:23 am    Post subject: IDATE routine: millenium bug? Reply with quote

Hi everybody,

I just discovered a strange thing in the IDATE Fortran-routine.
The following piece of code

INTEGER*4, DIMENSION(1:3) :: today
CALL IDATE (today) ! today(1)=day, (2)=month, (3)=year
PRINT*, today(1), today(2), today(3)

produces the result

7 6 106

7 is correct, 6 is also correct, but why 106 for the year?
Is this a compiler error, or am I doing something wrong?

Any advice is very much appreciated!
Lucas.

Lucas
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Wed Jun 07, 2006 10:11 am    Post subject: IDATE routine: millenium bug? Reply with quote

Lucas

It uses the localtime Microsoft function and the tm structure which has

tm_year: Year (current year minus 1900).

So you have to add 1900 to the result.

IDATE is not documented in the current help file.
Maybe you should be using the standard Fortran intrinsic DATE_AND_TIME.

Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Wed Jun 07, 2006 3:44 pm    Post subject: IDATE routine: millenium bug? Reply with quote

Hello Paul,

Many thanks for your information!
Indeed, the subroutine DATE_AND_TIME works perfect and the "1900"-problem is completely vanished!

Kind regards,
Lucas.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group