comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Error in function js2ymds (JHU/APL/S1R IDL Lib)?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Error in function js2ymds (JHU/APL/S1R IDL Lib)? [message #26584] Thu, 13 September 2001 09:44 Go to previous message
Olaf Stetzer is currently offline  Olaf Stetzer
Messages: 39
Registered: September 2001
Member
Hello,

as mentioned in my last posting I want to convert
Date/Time from Microsoft(Excel)-Format (based on
1.1.1900= day 1) into Julian Seconds and then from JS
into the ODBC-SQL-TIMESTAMP-struct.

For the last conversion I've written a function
which basically runs js2ymds to get the values
for y m d and then computes hh mm ss from the
resulting seconds.

All values are then stored in the aforementioned struct.

I now tried to compute the js from MS-Format and then
use my function to store this in the sqlstruct:
---
function mstime2sqlts, msdate, mstime

jsdate=(msdate-1)*86400d0-3155673600d0
js=mstime*86400d0+jsdate
sqlts=js2sqlts(js)
return, sqlts

end
---
However I realised that the dates which result from
my computation differ from the ones that I get when
I just change the format setting in Excel!

Some Examples:

msdate msdate (formatted) js2ymds

1 1900 1 1 1900 1 1
366 1900 12 31 1901 1 1
12481 1934 3 3 1934 3 4
36682 2000 6 5 2000 6 6

It seems that in the MS-year 1900 has 1 more day
compared to the one calculated by js2ymds!! I don't
know if the fault is in Microsoft Excel or in the
function js2ymds but maybe in 1900 there was an
extra switching day (german: Schalttag) which is
not calculated in the function?

Greetings,

Olaf

--
Dr. Olaf Stetzer
Forschungszentrum Karlsruhe
Institut f�r Meterologie und Klimaforschung
Atmosph�rische Aerosole (IMK III) - http://imk-aida.fzk.de
Tel.: +49(0)7247-82-3249 (FAX: -4332)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multi-threaded IDL
Next Topic: phase unwrapping

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:54:23 PDT 2025

Total time taken to generate the page: 0.47812 seconds