date-time format wrong!!

Mr. Bart Pietercil bart.pietercil at gmail.com
Tue Dec 11 15:40:34 CST 2007


Hi Thorsten,

thx for chiming in !

However it does seem like the problem is coming from VServer (or the  
kernel) since

3) Executing the 3 lines :


> set property DateTimeFormat OF DATABASE TO 'kYMD';
> set property DateSeparator OF DATABASE TO '-';
> select now()
>

in SQL editor in VStudio, ALSO returns WRONG formatted date!!
Like this : 11-12-2007 16:35:41:123


The database IS set to YYYYMMDD

So at least the NOW function is exhibiting the problem.
But also running a trigger that uses the now function inserts non  
yyyymmdd formated dates (and screws up all date handling we are doing  
in the backend)
HUGUE problem for us as the release date is approaching fast

Bart Pietercil



On 11-dec-07, at 22:00, Thorsten Hohage wrote:

> AFAIR I've already written this to the list when the "issue" popped  
> up some months ago, but here we go again...
>
> There are some issues in date handling in REALbasic, so don't blame  
> (only) Vaentina for this issue. When you use this
>
> 	field("").datevalue
>
> then it's REALbasic style you first cast the retrieved value to  
> this <ironic>wonderful</ironic> Variant type and the call a second  
> cast in pure RB to get an instance of the RB data class. Everything  
> what could go wrong here will go wrong here for sure at one of you  
> clients!
>
>
> So it's ways better to use the native Valentina methods
>
> 	Dim pDataSet As DDODataDictionary
> 	Dim pCursor As VCursor
> 	Dim dValue As Date
>
> 	dValue = pCursor.DateField(i).GetDate()
>
> OR
>
> 	dValue = pCursor.TimeField(i).GetTime()
>
> OR
>
> 	dValue = pCursor.DateTimeField(i).GetDateTime()
>
>
> then you can handle the intance of the RB date class in any way you  
> want. I can additional give the advice that if you ever want to  
> store these retrieved values in a Dictionary, then you should use  
> the above step, too and then do a
>
> 	pDataSet.Value("somenamehere") = dValue
>
> this will kept many headaches away from you.
>
>
> Of course it's the same story when writing the data back to  
> Valentina, DON'T USE THE RB STYLE, use the Valentina native
>
>
> 	Dim dummyDate As Date
>
>
> 	myCursor.DateField(i).SetDate(dummyDate)
>
> OR
>
> 	myCursor.DateTimeField(i).SetDateTime(dummyDate)
>
> OR
>
> 	myCursor.TimeField(i).SetTime(dummyDate)
>
>
>
> And for using values from dictionaries it's the same story as  
> retrieving, so always use a
>
> 	dummyDate = pDataList.Value(fieldName)
>
> to first get a real instance of the RB date class and then put it  
> into Valentina.
>
>
>
> Two additional remarks:
>
> * the date class is a real class and not a variable "type" like  
> Integer or Double. A lot of errors happens, because of a developer  
> didn't get the difference
>
> * Don't always trust the RB debugger in the most current versions,  
> there are a lot of glitches and especially with instances of the RB  
> date class they casted to string before displayed!!!!
>
>
> HTH
>
>
> On 2007-12-11, at 19:32, Joseph Morgan wrote:
>
>>
>> On Dec 11, 2007, at 9:31 AM, Danny Lewkin wrote:
>>
>>> It's even worse than that!!
>>>
>>> A string from RB, stored in the DB through a cursor, is also  
>>> stored in the wrong way!!
>>> What I mean is, the string in RB is 2007-12-11 14:35 (on debug  
>>> level), when I store it in the DB and do a select, it shows as  
>>> 11-12-2007 14:35 !!
>>>
>>> The function NOW() should NOT be influenced by de dateformat on a  
>>> pc!
>>> It should look at the dateformat of the DB, and work with that  
>>> setting!
>>> Well, in my opinion anyway!
>>
>>
>> I have always had difficulty with this as well. See my notes in  
>> Mantis ID 0002831:
>>
>> jojoSATX Mantis quote:
>>> realbasic rejects datevalue as a valid date
>>>
>>> look at it in the debugger of any correct database and the format  
>>> should be (I think):
>>> yyyy-mm-dd hh:mm:ss
>>>
>>> Any attempts to access the following fail:
>>> realbasics recordset.field("").datevalue
>>> recordset.idxfield("").datevalue
>>
>> Thanks,
>> joseph
>> _______________________________________________
>> Valentina mailing list
>> Valentina at lists.macserve.net
>> http://lists.macserve.net/mailman/listinfo/valentina
>
>
> regards
>
> Thorsten Hohage
> --
> objectmanufactur.com - Hamburg,Germany
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list