Dates not returning null

After our upgrade to 10.1.5 I have noticed a change.

Before, in version 9.2, whenever I pulled in the LastVisitedDate from a user profile, if the user has never visited after their account creation (null value in SQL), then it also returned null.

Now running the same scripts, then it returns 1/1/0001 12:00:00 AM.

Is this by design, or is it a bug?

Parents
  • Maybe it was like this in 10.0 and 10.2, but it was not working like this in 9.2.

    It's a bit annoying, as I had a widget checking on the field being null. Right now I'm having a bit of trouble checking this date.

    I'm trying with:

    #if ($user.LastVisitedDate == false) || ($user.LastVisitedDate > '0001-1-1 00:00:00.000')

    Also tried with '1/1/0001 12:00:00 AM'. But it doesn't work. Any suggestions regarding a workaround?

    And still wondering why it would set it to the birthday of Jesus. I'm using the code together with FormatAgoDate = telling the user last visited more than 2017 years ago!

Reply
  • Maybe it was like this in 10.0 and 10.2, but it was not working like this in 9.2.

    It's a bit annoying, as I had a widget checking on the field being null. Right now I'm having a bit of trouble checking this date.

    I'm trying with:

    #if ($user.LastVisitedDate == false) || ($user.LastVisitedDate > '0001-1-1 00:00:00.000')

    Also tried with '1/1/0001 12:00:00 AM'. But it doesn't work. Any suggestions regarding a workaround?

    And still wondering why it would set it to the birthday of Jesus. I'm using the code together with FormatAgoDate = telling the user last visited more than 2017 years ago!

Children