Date Comparison

  • Creator
    Topic
  • #49793
    Jeannette Wistrom
    Participant

    I need to compare two julian dates and get the difference between the two.  This is on a windows server and the dateDiff does not work.  Any suggestions?

Viewing 2 reply threads
  • Author
    Replies
    • #63614
      Kevin Kinnell
      Participant

      Jeannette Wistrom wrote:

      I need to compare two julian dates and get the difference between the two.  This is on a windows server and the dateDiff does not work.  Any suggestions?

      Jeannette–

      You might try getting GNU date (a binary for Windows is in the Coreutils package at http://gnuwin32.sourceforge.net/packages.html).  If you’re not familiar with GNU date it will pop your eyes with the number of different input forms it will accept (“yesterday” and “last monday” come to mind, the day of the year is no problem.)  It has an extensive set of formatting options for output as well.  You can pretty easily convert your J dates to epoch dates, subtract them and reconvert via ‘date’ or with a little arithmetic.

      hth

    • #63615
      Jeannette Wistrom
      Participant

      Thanks Kevin.  I actually used the clock scan command and it worked great.  I will check out your suggestion for future needs.

    • #63616
      Kevin Kinnell
      Participant

      Oh sure, do it the _easy_ way…   😆

      ‘date’ first came to my mind because I’ve been scripting something which needs to get the date for “yesterday”, and there’s no easier way for that than a quick pipe to date.

      –kevin (duh) kinnell

Viewing 2 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,300
Replies
34,445
Topic Tags
288
Empty Topic Tags
10