Jump to:

23358 Posts in 17874 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Null Date producing 01/01/1970

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 774 Views
  • Harley
    Avatar
    Community Member
    153 Posts

    Null Date producing 01/01/1970 Link to this post

    Hi,

    I know I've come across this before but can't seem to fathom this one again.

    When leaving a datefield blank I am getting a default value of 01/01/1970. What can I do to overcome this? I've tried if statements but to no avail.

    Thanks

  • martimiz
    Avatar
    Forum Moderator
    1067 Posts

    Re: Null Date producing 01/01/1970 Link to this post

    Where does this happen? If on your website, you could do a check, like:

    <% if MyDate %> Date: $MyDate.Nice <% end_if %>

    774 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.