How to enter dates as long

Bob B's Avatar

Bob B

24 Jun, 2020 06:59 PM

I'm trying to enter the creation date for an account which requires a long. I' can seem to figure out how to do it, the date always ends up as the current date (which I assume is the default). It's likely easy but I'm stumped.

  1. Support Staff 1 Posted by Sean Reilly on 24 Jun, 2020 10:36 PM

    Sean Reilly's Avatar

    Hi Bob,

    This is my fault - I've neglected to make an int date method for the account creation date, so it is using the long value which is returned from the java.util.Date object's getTime() method.

    There are a few ways to resolve this, but the simplest way that comes to mind, starting with an int YYYYMMDD date, is to use something like this:

    import com.infinitekind.util.DateUtil;
    int intDate = 20200624;
    long longDate = DateUtil.convertIntDateToLong(intDate).getTime();
    

    Or if you are already using java's Date class you can call getTime() on it to get the long value that moneydance is looking for. I'll add methods to get and set the date as an int, but of course that's not going to help you in the short term.

    Thanks,
    Sean

    --
    Sean Reilly
    Developer, The Infinite Kind
    https://infinitekind.com

  2. 2 Posted by -Kevin N. on 24 Jun, 2020 11:56 PM

    -Kevin N.'s Avatar

    *////////////////////////////////


    --------------------------------------]

  3. 3 Posted by -Kevin N. on 25 Jun, 2020 12:19 AM

    -Kevin N.'s Avatar

    Please ignore my previous post.

    Somehow my cat did that while I was away from my computer!

    I guess that's what I get for leaving my laptop open and unattended.

    Sorry.

    -Kevin N

  4. 4 Posted by dwg on 25 Jun, 2020 01:33 AM

    dwg's Avatar

    Hi Kevin,

    Your cat had something to say we just need someone that can translate it :)

  5. 5 Posted by -Kevin N. on 25 Jun, 2020 02:33 AM

    -Kevin N.'s Avatar

    If she starts buying stuff on E-bay, I'm going to have to put my foot down.

  6. 6 Posted by dwg on 25 Jun, 2020 03:27 AM

    dwg's Avatar

    There is a pet shop ad on Australian TV that has the animals buying over the net ....

    Be very afraid.

  7. 7 Posted by Bob B on 25 Jun, 2020 03:40 AM

    Bob B's Avatar

    Thank you Sean, that's been very helpful. (Hi to the critter dwg and Kevin)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac