Message from discussion
set date/timstamp to null
Received: by 10.101.6.10 with SMTP id j10mr2560522ani.2.1349026989107;
Sun, 30 Sep 2012 10:43:09 -0700 (PDT)
X-BeenThere: propel-users@googlegroups.com
Received: by 10.236.149.34 with SMTP id w22ls9524559yhj.8.gmail; Sun, 30 Sep
2012 10:43:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.236.192.164 with SMTP id i24mr1967709yhn.14.1349026988212;
Sun, 30 Sep 2012 10:43:08 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
fvez...@gmail.com designates internal as permitted sender)
smtp.mail=fvez...@gmail.com; dkim=pass
header...@gmail.com
Received: by w3g2000yqe.googlegroups.com with HTTP; Sun, 30 Sep 2012 10:43:08
-0700 (PDT)
Date: Sun, 30 Sep 2012 10:43:08 -0700 (PDT)
In-Reply-To: <8b814935-9ca1-4446-9d97-c20eb3d2923b@l18g2000vbv.googlegroups.com>
References: <d225e8a7-fb75-455b-b330-2c24c19099f0@googlegroups.com>
<CAD-BwEvC_2WukbOuVkPRo8oR4_KnvgbHjB=0FYOKMZR-9Du02g@mail.gmail.com>
<f0ca5d0f-9bfe-483f-b0e1-9f2923937e2f@m9g2000yqi.googlegroups.com>
<CAF-4w363gJ2_Qe6V9n+3R7de_Ciz6cYHnY3+yn8xa2o3Lg4L2w@mail.gmail.com> <8b814935-9ca1-4446-9d97-c20eb3d2923b@l18g2000vbv.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1,gzip(gfe)
Message-ID: <0e8fca76-60a0-4e05-bf31-91b39606dcee@w3g2000yqe.googlegroups.com>
Subject: Re: set date/timstamp to null
From: drez <fvez...@gmail.com>
To: Propel Users <propel-users@googlegroups.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Also, same error with DATE field
On Sep 28, 10:05=C2=A0am, drez <fvez...@gmail.com> wrote:
> Hi,
> I am currently using a Timestamps set to required=3Dfalse in Propel
> 1.6.X (last debian version), MySql.
> The field start null ok, but setting a date, then setting it back to
> null with $myObject->setMyDateTimeField(null); gives me an error
> "Uncaught exception 'Exception' with message 'DateTime::__construct():
> Failed to parse time string (null) at position 0 (n)".
>
> I also tried to set '0000-00-00 00:00:00' as my base value, and again,
> I could not figure how to make it work. Setting the value in the db is
> alright, but I haven't been able to set/query it with Propel so far.
>
> Any idea ?
>
> On Sep 28, 1:42=C2=A0am, Carsten Schumann <carsten.schum...@googlemail.co=
m>
> wrote:
>
>
>
>
>
>
>
> > Hi Fred,
>
> > I'm using normal DateTime columns and setting DateTime columns to NULL
> > works fine (at least with my propel Version).
>
> > To understand your problem:
> > =C2=A0 1. Which version of propel are you using?
> > =C2=A0 2. What columntype did you define in your schema.xml/.yml file? =
TIMESTAMP?
> > =C2=A0 3. Did you set the required field to false in your schema.xml/.y=
ml file?
> > =C2=A0 4. Is that column in your database also allowing NULL values?
> > (That's especially an issue if you change the required field later)
> > =C2=A0 5. How do you set your date to "no date"?
> > $myObject->setMyDateTimeField(null); ?
>
> > Carsten
>
> > On Thu, Sep 27, 2012 at 11:18 PM, drez <fvez...@gmail.com> wrote:
> > > Yeah I understand, since I use date everywhere that would be sad to
> > > have to change it all... and it worked very well since I needed to
> > > have a "no date set yet" state ... but thanks !
>
> > > On Sep 27, 3:17 pm, =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9 =D0=A1=
=D0=B8=D0=B4=D0=B0=D1=88 <alexeysid...@gmail.com> wrote:
> > >> 2012/9/27 drez <fvez...@gmail.com>
>
> > >> > Hi,
> > >> > I have a field who need to be a date or no date.
>
> > >> > I have tryed all I can think of using null or '0000-00-00 00:00:00=
' and it
> > >> > have always resulted in error while getting or setting.
>
> > >> > Any way to do that ?
>
> > >> > Thank you,
> > >> > Fred
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google=
Groups
> > >> > "Propel Users" group.
> > >> > To view this discussion on the web visit
> > >> >https://groups.google.com/d/msg/propel-users/-/HyuUd2B7DuIJ.
> > >> > To post to this group, send email to propel-users@googlegroups.com=
.
> > >> > To unsubscribe from this group, send email to
> > >> > propel-users+unsubscribe@googlegroups.com.
> > >> > For more options, visit this group at
> > >> >http://groups.google.com/group/propel-users?hl=3Den.
>
> > >> Drez,As form me i use integer columns for date and function date(), =
so i
> > >> dont have such problems.
>
> > > --
> > > You received this message because you are subscribed to the Google Gr=
oups "Propel Users" group.
> > > To post to this group, send email to propel-users@googlegroups.com.
> > > To unsubscribe from this group, send email to propel-users+unsubscrib=
e@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/p=
ropel-users?hl=3Den.