Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Fwd: PHP MongoDate changed to ISODate, why?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sam Millman  
View profile  
 More options Sep 16 2012, 7:20 pm
From: Sam Millman <sam.mill...@gmail.com>
Date: Mon, 17 Sep 2012 00:20:10 +0100
Local: Sun, Sep 16 2012 7:20 pm
Subject: Fwd: PHP MongoDate changed to ISODate, why?

Forwarding back down to mongodb-user. Poster accidently posted directly to
me.

On 17 September 2012 00:19, Sam Millman <sam.mill...@gmail.com> wrote:

> PHP Driver comes bundled with MongoDate:
> http://php.net/manual/en/class.mongodate.php

> You can use it like:

> $db->insert(array('ts' => new MongoDate()));

> Adding a time() arg to the class call will set the date to that time.

> On 16 September 2012 23:44, KevOu <kevin.chi...@gmail.com> wrote:

>> Sam,

>> Sorry I don't know if my previous message went through...
>> Would you know the best way to "prepare" a php date to upload to mongo
>> db ISODate format ?
>> You said date() object is dead so which one do you suggest to use ?

>> Thanks for your kind help,

>> On 4 oct 2011, 22:14, Sam Millman <sam.mill...@gmail.com> wrote:
>> > Ha!

>> > I only just noticed the original question:

>> > "Any idea's what I "accidentally" did to trigger the change?"

>> > Answer: You upgraded.

>> > The old date() object is dead. You need not do anything different it
>> will
>> > just make the date storing in the DB better.

>> > On 4 October 2011 21:07, Sam Millman <sam.mill...@gmail.com> wrote:

>> > > Also ISODate is international format:

>> > >http://www.w3.org/QA/Tips/iso-date

>> > > Basically it is better than the old date object

>> > > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:

>> > >> What I was meant to say on the end of that is that so long as they
>> do not
>> > >> come out of your PHP script escaped everyhting is fine.

>> > >> If they do then there is something afoot that we need to get to the
>> root
>> > >> of.

>> > >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:

>> > >>> ISO date is tz compliant, notice the format of the time when
>> looking at
>> > >>> it in shell.

>> > >>> escaping is normal for BSON (think of JSON) arrays. Slashs is
>> always a
>> > >>> bit of a problem.

>> > >>> How exactly are they being stored in your DB?

>> > >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me>
>> wrote:

>> > >>>> No thoughts?

>> > >>>> I noticed another anomaly, all the "/" symbols are now escaped!
>> > >>>>  (http:\/\/someurl.com).  Cannot figure this out either.  Maybe
>> > >>>> related?

>> > >>>> Sent from my iPhone

>> > >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com>
>> wrote:

>> > >>>>  Hi,

>> > >>>> MongoDate[0] representes date objects for the database which are
>> > >>>> ISODates[1].

>> > >>>> [0] <http://www.php.net/manual/en/class.mongodate.php>
>> > >>>>http://www.php.net/manual/en/class.mongodate.php
>> > >>>> [1] <
>> http://www.mongodb.org/display/DOCS/Data+Types+and+Conventions>
>> > >>>>http://www.mongodb.org/display/DOCS/Data+Types+and+Conventions

>> > >>>> Cheers

>> > >>>>  ------------------------------

>> > >>>>  <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
>> > >>>> 3 de octubre de 2011 23:24

>> > >>>> Hello,

>> > >>>> I recently updated a library that uses PHP's MongoDate to store all
>> > >>>> date related fields.

>> > >>>> After running the library I noticed MongoDate objects were no
>> longer
>> > >>>> being stored. Instead an ISOdate object is stored.

>> > >>>> Any idea's what I "accidentally" did to trigger the change?

>> > >>>> Thanks

>> > >>>>   --
>> > >>>> You received this message because you are subscribed to the Google
>> > >>>> Groups "mongodb-user" group.
>> > >>>> To post to this group, send email to mongodb-user@googlegroups.com
>> .
>> > >>>> To unsubscribe from this group, send email to
>> > >>>> mongodb-user+unsubscribe@googlegroups.com.
>> > >>>> For more options, visit this group at
>> > >>>>http://groups.google.com/group/mongodb-user?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.