Date Field displaying 12/31/1969

Posted by Rollbase User on 15-Mar-2013 09:26

We have (for some time just reporting) had an issue of when using dates in APIs and triggers, if the date is empty or blank or Null (whatever) the system plugs in 12/31/1969. See attached screenshot. You cannot clear it either. How do we address this, is there a specific value we should pass to keep it empty? Thanks Adam

All Replies

Posted by Admin on 15-Mar-2013 10:52

What exactly is "Eff Start Date" ? If it's a formula, I need to know what type of data it returns.

Posted by Roman on 02-Feb-2014 06:03

I have the same issue here.

I have a trigger that is copying date filed from one object to another.

Instead of Zero I'm getting 31/12/1969

Posted by Bill Wood on 02-Feb-2014 07:08

I am not sure what steps you did in particular,  but this date is the "0" date in java.  If you look at the javadocs, this constructor on Date uses an offset from baseline time:

Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

If you don't get the 1970 value you are probably on EST, or a time zone west of Greenwich, England, hence the result.

I do realize that while this explains why you are seeing Dec 31, 2014, it does not answer your real question which is 'how do you show an 'empty' datafield that has no value?'     (Generally, and this is not tied to Rollbase, per se, you could initialize the value at a date you want to show --- so if the effective start date is not 'known' then you could set it (not to 0) but to 'TODAY' or '1/1/CURRENT_YEAR')

This thread is closed