Lee, Yeah, since there is no 'date' type in javaScript they store a datestamp and then OB GET($obj;"key" Is date) function gets and returns just the date value. I expect it does the same with time. And to Bertrand's point 4D must be doing some sort of automatic conversion with some variable types working better than others.
I've taken to declaring the data type whenever I use OB GET just because. Except when I'm sure it's a text value and I want text. But this makes me think I should stop doing that. On Wed, Aug 17, 2016 at 7:22 AM, Lee Hinde <leehi...@gmail.com> wrote: > It's the 'usually' part that caught me. This is the first time I've run > into it. > > *C_LONGINT*($long;$newlong) > > $long:=1 > > *OB SET*($object;"long";$Long) > > $newlong:=*OB Get*($object;"long") > > > Works fine. > > Also note (this may be documented, but I didn't notice), the date field in > the original example is stored in the $object as a datetime. > > > On Tue, Aug 16, 2016 at 11:34 PM, Kirk Brooks <lists.k...@gmail.com> > wrote: > > > Yeah, if you don't specify the return type it comes back as text - > usually, > > ie. > > > > C_OBJECT($object) > > C_DATE($date) > > C_TEXT($key;$dateStr) > > > > $key:="current_date" > > > > OB SET($object;$key;Current date(*)) > > $dateStr:=OB Get($object;$key) > > $date:=OB Get($object;$key;Is date) > > > > > > > > On Tue, Aug 16, 2016 at 5:46 PM, Lee Hinde <leehi...@gmail.com> wrote: > > > > > Paste this in your v15 scratch method and run it.: > > > > > > > > > *C_OBJECT*($object) > > > > > > *C_DATE*($date) > > > > > > *C_TEXT*($key) > > > > > > $key:="current_date" > > > > > > > > > *OB SET*($object;$key;*Current date*(*)) > > > > > > $date:=*OB Get*($object;$key) > > > > > > > > > $date:=*OB Get*($object;$key;Is date) > > > > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** > -- Kirk Brooks San Francisco, CA ======================= ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************