Loading ...
Sorry, an error occurred while loading the content.

Re: Date format in currdat.lst (Heavy Weather v1.1)

Expand Messages
  • Joe
    Ahh, a 70-year difference in epochs. Using the # of days between Jan 1, 1900 and Jan 1, 1970 (25567), I was able to do the conversion correctly in Perl. The
    Message 1 of 7 , Dec 29, 2006
    • 0 Attachment
      Ahh, a 70-year difference in epochs.

      Using the # of days between Jan 1, 1900 and Jan 1, 1970 (25567), I was
      able to do the conversion correctly in Perl.

      The perl script isn't very portable at the moment, and only uploads
      the datasets that my weather station can handle (no wind info, etc),
      but if anyone in the group would be interested in using it or
      improving it, let me know and I'll make the code available.

      Thanks for the code snippet, and for the info!

      --Joe



      --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
      <wuhu_software@...> wrote:
      >
      >
      >
      > The comment line was supposed to read:
      >
      > // 25567 days from Saturday, January 1, 1900 to Sunday, January 1,
      > 1970 (where time_t seconds counts from)
      >
      >
      >
      > --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
      > <wuhu_software@> wrote:
      > >
      > >
      > > Joe,
      > >
      > > I had to look back at the code.
      > >
      > > You were right, there was a big difference in the two.
      > >
      > > I am pretty sure the epoch they use is from Jan 1, 1900.
      > >
      > > Here is the routine I use to convert.
      > >
      > > double Convert_time_t_To_DateTime(time_t vtime_t)
      > >
      > > {
      > > double fresult;
      > >
      > > // 25567 days from Saturday, January 1, 1900 to Sunday, January 7,
      > > 1900 (where time_t seconds counts from)
      > >
      > > __int64 nDelta = 25567; // was 25569
      > >
      > > nDelta *= (__int64)(60 * 60 * 24);
      > >
      > > nDelta += vtime_t;
      > >
      > > fresult = (double)nDelta;
      > >
      > > return (fresult);
      > > }
      > >
      > >
      > > --- In wuhu_software_group@yahoogroups.com, "Joe" joewerner@
      > > wrote:
      > > >
      > > >
      > > > Thanks for the response.
      > > >
      > > > I'm still a bit confused, as Unix time is currently 1167404352,
      > > while
      > > > the time in the last_actualisation field is currently 3376392894,
      > > > which is *much* higher. If this was a UTC issue, I would expect to
      > > > see a much smaller difference (approx. 18000 seconds) for my time
      > > zone
      > > > (UTC -5).
      > > >
      > > > Does the weather station use a different epoch? Maybe it's just not
      > > > configured properly? I remember having to set the date/time
      > > manually,
      > > > because I wasn't receiving the atomic clock broadcasts from where
      > > the
      > > > station is situated.
      > > >
      > > > The good news is that I finished off the perl script, and I found a
      > > > work-around for finding the time to submit to WU. I'm using the
      > > mtime
      > > > of the currdat.lst file.
      > > >
      > > > Thanks again!
      > > >
      > > > Joe
      > > >
      > > >
      > > > --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
      > > > <wuhu_software@> wrote:
      > > > >
      > > > >
      > > > > Joe,
      > > > >
      > > > > Welcome to the group.
      > > > >
      > > > > You are right, it is unix type time but it is in terms of UTC not
      > > > > local time.
      > > > >
      > > > >
      > > > > --- In wuhu_software_group@yahoogroups.com, "Joe" <joewerner@>
      > > > > wrote:
      > > > > >
      > > > > > Hey all,
      > > > > >
      > > > > > I just got a La Crosse 3510 and I'm really happy to have found
      > > the
      > > > > > WUHU software. It's great for Windows.
      > > > > >
      > > > > > I'm looking for a way to upload the weather data from
      > > currdat.lst in
      > > > > > Linux.
      > > > > >
      > > > > > I found a Perl script that looks promising -- it's designed for
      > > a
      > > > > data
      > > > > > file from a different weather station, but I'm planning on
      > > modifying
      > > > > > it to parse currdat.lst.
      > > > > >
      > > > > > So, here's my question:
      > > > > >
      > > > > > I need to convert the last_actualisation value to a human-
      > > readable
      > > > > > time. Currently it looks like this:
      > > > > >
      > > > > > last_actualisation="3376307991"
      > > > > >
      > > > > > I tried using Heavy Weather v2.0 Beta, which has human-readable
      > > time
      > > > > > in currdat.lst, but it will not work with the 3510 weather
      > > station.
      > > > > > I'm forced to use version 1.1, which came on the CD.
      > > > > >
      > > > > > Any ideas about how to convert this time string? It looks
      > > similiar
      > > > > to
      > > > > > unix time (seconds since epoch), but it doesn't seem to match
      > > unix
      > > > > > time exactly.
      > > > > >
      > > > > > Any help/suggestions would be greatly appreciated.
      > > > > >
      > > > > > --Joe
      > > > > >
      > > > >
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.