- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TYPE(T_SYSTEMTIME) :: st ! note -- all SYSTEMTIME components are INTEGER*2
!TYPE T_SYSTEMTIME !SEQUENCE ! integer(WORD) wYear ! knowns WORD ! integer(WORD) wMonth ! knowns WORD ! integer(WORD) wDayOfWeek ! knowns WORD ! integer(WORD) wDay ! knowns WORD ! integer(WORD) wHour ! knowns WORD ! integer(WORD) wMinute ! knowns WORD ! integer(WORD) wSecond ! knowns WORD ! integer(WORD) wMilliseconds ! knowns WORD !END TYPE CALL GetLocalTime (st)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul-Curtis,
How did you learn about this function/type/call? I have a Programming Windows book which I hoped would have some info on Win32 APIs, but it doesn't seem to contain the info I need.
Chad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The primary referential material is Microsoft "Platform SDK" documentation.
- it is bundled with CVF online help
- however (probably due to licensing issues) it is not bundled with IVF documentation. You can find it in MSDN if you installed it with VS.NET
- it is available online on MSDN site
- You can freely download an older, but quite useful and concise version from Borland
HTH
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jugoslav! If I wanted to retrieve the information from this, I would do the following...
Year_Now = st.wYear
Right?
Man, Win32 library is HUGE! I know for those that have been working with it for a long time that's kind of like a "duh" statement, but from a newbie standpoint, it's like being given a haystack and trying to find the needle. The good thing is that there is a way to search it online and offline.
Chad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Components within defined types are punctuated by % or period.
If your variable is a standard F90 integer, then
Year_Now = INT4(st%wYear)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows API is huge indeed. If you can find a "book-chapter" version of documentation (such as MSDN or CVF version), you will find that docs are fairly well organized (Introduction, detailed explanations and reference chapter) and routines are mostly logically named (except when not :-) ). However, that doesn't make it much easier to grab (nor every programmer needs all of it -- my personal rough estimate is that I didn't use more than 30% of it). Petzold is IMO an excellent starting book, but it mostly discuses typical GUI aspects. Jerry Richter's "Advanced Windows" is more comprehensive but also more advanced.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FUNCTION julian_date (yyyy, mm, dd) RESULT (julian) IMPLICIT NONE ! converts calendar date to Julian date ! cf Fliegel & Van Flandern, CACM 11(10):657, 1968 ! example: julian_date(1970,1,1)=2440588 INTEGER,INTENT(IN) :: yyyy,mm,dd INTEGER :: julian julian = dd - 32075 + 1461*(yyyy + 4800 + (mm - 14)/12)/4 + & 367*(mm - 2 - ((mm - 14)/12)*12)/12 - & 3*((yyyy + 4900 + (mm - 14)/12)/100)/4 END FUNCTION julian_date SUBROUTINE get_ymd (jd, yyyy, mm, dd) IMPLICIT NONE ! expands a Julian date into a calendar date ! cf Fliegel & Van Flandern, CACM 11(10):657, 1968 INTEGER,INTENT(IN) :: jd INTEGER,INTENT(OUT) :: yyyy,mm,dd INTEGER :: l,n l = jd + 68569 n = 4*l/146097 l = l - (146097*n + 3)/4 yyyy = 4000*(l + 1)/1461001 l = l - 1461*yyyy/4 + 31 mm = 80*l/2447 dd = l - 2447*mm/80 l = mm/11 mm = mm + 2 - 12*l yyyy = 100*(n - 49) + yyyy + l END SUBROUTINE get_ymd INTEGER FUNCTION dow (yyyy,mm,dd) IMPLICIT NONE ! Day_Of_Week: (0=Sunday,1=Monday...6=Saturday) ! cf J.D.Robertson, CACM 15(10):918 INTEGER,INTENT(IN) :: yyyy,mm,dd dow = MOD((13*(mm+10-(mm+10)/13*12)-1)/5+dd+77 & +5*(yyyy+(mm-14)/12-(yyyy+(mm-14)/12)/100*100)/4 & +(yyyy+(mm-14)/12)/400-(yyyy+(mm-14)/12)/100*2,7) END FUNCTION dow INTEGER FUNCTION ndiy (yyyy,mm,dd) IMPLICIT NONE ! day count in year ! cf J.D.Robertson, CACM 15(10):918 INTEGER,INTENT(IN) :: yyyy,mm,dd ndiy = 3055*(mm+2)/100-(mm+10)/13*2-91 & +(1-(MOD(yyyy,4)+3)/4+(MOD(yyyy,100)+99)/100 & -(MOD(yyyy,400)+399)/400)*(mm+10)/13+dd END FUNCTION ndiy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, I remember having to do this for a programming assignment about 10 years ago... or has it been longer... time flies :) Of course, I haven't been developing that long. I've worn so many hats since then. WithWin32 programming, I kept hearingthat there wereAPIs for everything you wanted to do. Unless Microsoft didn't want to take away from the professor's programming lessons, I was thinking there has to be an API for calculating the Julian date. I was looking around, but I didn't see anything that matched.
Paul-Curtis, thanks for the code samples. This helps me in not having to reinvent the wheel ;) Jugoslav, I saw the APIs that you mentioned, but I didn't think they would apply. I'll take another look at them. Thanks for pointing them out :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page